chore: fix issue where application deinit was called twice
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
export const Web_TYPES = {
|
||||
Application: Symbol.for('Application'),
|
||||
|
||||
// Services
|
||||
AndroidBackHandler: Symbol.for('AndroidBackHandler'),
|
||||
ArchiveManager: Symbol.for('ArchiveManager'),
|
||||
|
||||
@@ -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, () => {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user