Skip to content

Commit

Permalink
fix issue with stuff being cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Sep 19, 2022
1 parent 3d458e0 commit 144acdd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ const router = new Router({
})

function hasQueryParameters(route) {
return Object.prototype.hasOwnProperty.call(route.query, 'instanceId')
return (
Object.prototype.hasOwnProperty.call(route.query, 'instanceId') ||
Object.prototype.hasOwnProperty.call(route.query, 'isCustomLogin') ||
Object.prototype.hasOwnProperty.call(route.query, 'namespace')
)
}

router.beforeResolve((to, from, next) => {
Expand All @@ -178,7 +182,7 @@ router.beforeResolve((to, from, next) => {
}
if (!hasQueryParameters(to) && hasQueryParameters(from)) {
if (!to.name.includes('Topup') && to.name !== 'walletTransfer') {
Object.keys(from.query).forEach((key) => key === 'instanceId' || delete from.query[key])
Object.keys(from.query).forEach((key) => key === 'instanceId' || key === 'namespace' || key === 'isCustomLogin' || delete from.query[key])
}
return next({ name: to.name, query: from.query, hash: to.hash, params: to.params })
// next()
Expand Down

0 comments on commit 144acdd

Please sign in to comment.