chore: fix issue where application deinit was called twice

This commit is contained in:
Mo
2023-08-24 08:48:56 -05:00
parent 3dd9504a85
commit a5bb112df5
3 changed files with 3 additions and 7 deletions

View File

@@ -1,6 +1,4 @@
export const Web_TYPES = {
Application: Symbol.for('Application'),
// Services
AndroidBackHandler: Symbol.for('AndroidBackHandler'),
ArchiveManager: Symbol.for('ArchiveManager'),

View File

@@ -100,8 +100,6 @@ export class WebDependencies extends DependencyContainer {
return new AndroidBackHandler()
})
this.bind(Web_TYPES.Application, () => this.application)
this.bind(Web_TYPES.ItemGroupController, () => {
return new ItemGroupController(
application.items,
@@ -124,7 +122,7 @@ export class WebDependencies extends DependencyContainer {
})
this.bind(Web_TYPES.ArchiveManager, () => {
return new ArchiveManager(this.get<WebApplicationInterface>(Web_TYPES.Application))
return new ArchiveManager(application)
})
this.bind(Web_TYPES.ThemeManager, () => {

View File

@@ -177,12 +177,12 @@ export class WebApplication extends SNApplication implements WebApplicationInter
}
override deinit(mode: DeinitMode, source: DeinitSource): void {
super.deinit(mode, source)
if (!this.isNativeMobileWeb()) {
this.webOrDesktopDevice.removeApplication(this)
}
super.deinit(mode, source)
for (const disposer of this.disposers) {
disposer()
}