diff --git a/platypush/backend/http/webapp/src/utils/Url.vue b/platypush/backend/http/webapp/src/utils/Url.vue index 3f667437cf..4a7e17d9e3 100644 --- a/platypush/backend/http/webapp/src/utils/Url.vue +++ b/platypush/backend/http/webapp/src/utils/Url.vue @@ -22,10 +22,22 @@ export default { }, setUrlArgs(args) { - args = {...this.getUrlArgs(), ...args} - window.location.href = ( - `${window.location.pathname}#${this.parseUrlFragment()}?${this.fragmentFromArgs(args)}` - ) + const curArgs = this.getUrlArgs() + args = Object.entries(args) + .reduce((acc, [key, value]) => { + if (value != null) + acc[key] = value + else if (curArgs[key] != null) + delete curArgs[key] + return acc + }, {}) + + args = {...curArgs, ...args} + let location = `${window.location.pathname}#${this.parseUrlFragment()}` + if (Object.keys(args).length) + location += `?${this.fragmentFromArgs(args)}` + + window.location.href = location }, fragmentFromArgs(args) {