refactor: pass sub controllers to controllers instead of passing global controller manager (#1061)

This commit is contained in:
Mo
2022-06-01 12:56:30 -05:00
committed by GitHub
parent 721cf8df35
commit a87e3b98e2
40 changed files with 672 additions and 591 deletions

View File

@@ -13,7 +13,8 @@ import {
DesktopClientRequiresWebMethods,
DesktopDeviceInterface,
} from '@standardnotes/snjs'
import { WebAppEvent, WebApplication } from '@/Application/Application'
import { WebApplication } from '@/Application/Application'
import { WebAppEvent } from '@/Application/WebAppEvent'
export class DesktopManager
extends ApplicationService
@@ -106,11 +107,11 @@ export class DesktopManager
}
windowGainedFocus(): void {
this.webApplication.notifyWebEvent(WebAppEvent.DesktopWindowGainedFocus)
this.webApplication.notifyWebEvent(WebAppEvent.WindowDidFocus)
}
windowLostFocus(): void {
this.webApplication.notifyWebEvent(WebAppEvent.DesktopWindowLostFocus)
this.webApplication.notifyWebEvent(WebAppEvent.WindowDidBlur)
}
async onComponentInstallationComplete(componentData: DecryptedTransferPayload<ComponentContent>, error: unknown) {
@@ -155,10 +156,10 @@ export class DesktopManager
}
didBeginBackup() {
this.webApplication.getViewControllerManager().beganBackupDownload()
this.webApplication.notifyWebEvent(WebAppEvent.BeganBackupDownload)
}
didFinishBackup(success: boolean) {
this.webApplication.getViewControllerManager().endedBackupDownload(success)
this.webApplication.notifyWebEvent(WebAppEvent.EndedBackupDownload, { success })
}
}