feat(web): move emails notifications to one pane and enable opening settings via url (#1614)

* feat(web): move emails notifications to one pane and enable opening settings via url

* fix(web): rename notifications to email

* fix(snjs): add mute marketing emails to settings list options

* fix(web): linter issues
This commit is contained in:
Karol Sójko
2022-09-22 12:40:08 +02:00
committed by GitHub
parent ac1f59cde7
commit 1fe833bc24
6 changed files with 171 additions and 41 deletions

View File

@@ -29,9 +29,18 @@ export class PreferencesController {
closePreferences = (): void => {
this._open = false
this.currentPane = DEFAULT_PANE
this.removePreferencesToggleFromURLQueryParameters()
}
get isOpen(): boolean {
return this._open
}
private removePreferencesToggleFromURLQueryParameters() {
const urlSearchParams = new URLSearchParams(window.location.search)
urlSearchParams.delete('settings')
const newUrl = `${window.location.origin}${window.location.pathname}${urlSearchParams.toString()}`
window.history.replaceState(null, document.title, newUrl)
}
}