Revert "Revert "feat(web): move emails notifications to one pane and enable opening settings via url (#1614)" (#1617)" (#1619)
This reverts commit 6824dd2d5f.
This commit is contained in:
@@ -29,6 +29,8 @@ import { NavigationController } from './Navigation/NavigationController'
|
||||
import { FilePreviewModalController } from './FilePreviewModalController'
|
||||
import { SelectedItemsController } from './SelectedItemsController'
|
||||
import { HistoryModalController } from './NoteHistory/HistoryModalController'
|
||||
import { PreferenceId } from '@/Components/Preferences/PreferencesMenu'
|
||||
import { AccountMenuPane } from '@/Components/AccountMenu/AccountMenuPane'
|
||||
|
||||
export class ViewControllerManager {
|
||||
readonly enableUnfinishedFeatures: boolean = window?.enabledUnfinishedFeatures
|
||||
@@ -209,11 +211,31 @@ export class ViewControllerManager {
|
||||
|
||||
addAppEventObserver() {
|
||||
this.unsubAppEventObserver = this.application.addEventObserver(async (eventName) => {
|
||||
const urlSearchParams = new URLSearchParams(window.location.search)
|
||||
|
||||
switch (eventName) {
|
||||
case ApplicationEvent.Launched:
|
||||
if (window.location.search.includes('purchase=true')) {
|
||||
if (urlSearchParams.get('purchase')) {
|
||||
this.purchaseFlowController.openPurchaseFlow()
|
||||
}
|
||||
if (urlSearchParams.get('settings')) {
|
||||
const user = this.application.getUser()
|
||||
if (user === undefined) {
|
||||
this.accountMenuController.setShow(true)
|
||||
this.accountMenuController.setCurrentPane(AccountMenuPane.SignIn)
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
this.preferencesController.openPreferences()
|
||||
this.preferencesController.setCurrentPane(urlSearchParams.get('settings') as PreferenceId)
|
||||
}
|
||||
break
|
||||
case ApplicationEvent.SignedIn:
|
||||
if (urlSearchParams.get('settings')) {
|
||||
this.preferencesController.openPreferences()
|
||||
this.preferencesController.setCurrentPane(urlSearchParams.get('settings') as PreferenceId)
|
||||
}
|
||||
break
|
||||
case ApplicationEvent.SyncStatusChanged:
|
||||
this.syncStatusController.update(this.application.sync.getSyncStatus())
|
||||
|
||||
Reference in New Issue
Block a user