chore: fix issue where application deinit was called twice
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
export const Web_TYPES = {
|
export const Web_TYPES = {
|
||||||
Application: Symbol.for('Application'),
|
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
AndroidBackHandler: Symbol.for('AndroidBackHandler'),
|
AndroidBackHandler: Symbol.for('AndroidBackHandler'),
|
||||||
ArchiveManager: Symbol.for('ArchiveManager'),
|
ArchiveManager: Symbol.for('ArchiveManager'),
|
||||||
|
|||||||
@@ -100,8 +100,6 @@ export class WebDependencies extends DependencyContainer {
|
|||||||
return new AndroidBackHandler()
|
return new AndroidBackHandler()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.bind(Web_TYPES.Application, () => this.application)
|
|
||||||
|
|
||||||
this.bind(Web_TYPES.ItemGroupController, () => {
|
this.bind(Web_TYPES.ItemGroupController, () => {
|
||||||
return new ItemGroupController(
|
return new ItemGroupController(
|
||||||
application.items,
|
application.items,
|
||||||
@@ -124,7 +122,7 @@ export class WebDependencies extends DependencyContainer {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.bind(Web_TYPES.ArchiveManager, () => {
|
this.bind(Web_TYPES.ArchiveManager, () => {
|
||||||
return new ArchiveManager(this.get<WebApplicationInterface>(Web_TYPES.Application))
|
return new ArchiveManager(application)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.bind(Web_TYPES.ThemeManager, () => {
|
this.bind(Web_TYPES.ThemeManager, () => {
|
||||||
|
|||||||
@@ -177,12 +177,12 @@ export class WebApplication extends SNApplication implements WebApplicationInter
|
|||||||
}
|
}
|
||||||
|
|
||||||
override deinit(mode: DeinitMode, source: DeinitSource): void {
|
override deinit(mode: DeinitMode, source: DeinitSource): void {
|
||||||
super.deinit(mode, source)
|
|
||||||
|
|
||||||
if (!this.isNativeMobileWeb()) {
|
if (!this.isNativeMobileWeb()) {
|
||||||
this.webOrDesktopDevice.removeApplication(this)
|
this.webOrDesktopDevice.removeApplication(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.deinit(mode, source)
|
||||||
|
|
||||||
for (const disposer of this.disposers) {
|
for (const disposer of this.disposers) {
|
||||||
disposer()
|
disposer()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user