fix(web): change component keys to use id tied to controller lifecycle instead of item id (#1681)
* fix(web): change component keys to use id tied to controller lifecycle instead of item id * chore: lint
This commit is contained in:
@@ -149,6 +149,9 @@ class NoteView extends PureComponent<NoteViewProps, State> {
|
||||
}
|
||||
|
||||
override deinit() {
|
||||
super.deinit()
|
||||
;(this.controller as unknown) = undefined
|
||||
|
||||
window.removeEventListener('scroll', this.handleWindowScroll)
|
||||
|
||||
this.removeComponentStreamObserver?.()
|
||||
@@ -165,7 +168,6 @@ class NoteView extends PureComponent<NoteViewProps, State> {
|
||||
|
||||
this.clearNoteProtectionInactivityTimer()
|
||||
;(this.ensureNoteIsInsertedBeforeUIAction as unknown) = undefined
|
||||
;(this.controller as unknown) = undefined
|
||||
|
||||
this.removeTabObserver?.()
|
||||
this.removeTabObserver = undefined
|
||||
@@ -173,7 +175,6 @@ class NoteView extends PureComponent<NoteViewProps, State> {
|
||||
|
||||
this.statusTimeout = undefined
|
||||
;(this.onPanelResizeFinish as unknown) = undefined
|
||||
super.deinit()
|
||||
;(this.dismissProtectedWarning as unknown) = undefined
|
||||
;(this.editorComponentViewerRequestsReload as unknown) = undefined
|
||||
;(this.onTextAreaChange as unknown) = undefined
|
||||
@@ -313,6 +314,10 @@ class NoteView extends PureComponent<NoteViewProps, State> {
|
||||
}
|
||||
|
||||
override async onAppEvent(eventName: ApplicationEvent) {
|
||||
if (this.controller?.dealloced) {
|
||||
return
|
||||
}
|
||||
|
||||
switch (eventName) {
|
||||
case ApplicationEvent.PreferencesChanged:
|
||||
this.reloadPreferences().catch(console.error)
|
||||
|
||||
Reference in New Issue
Block a user