mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-04-13 13:26:42 -05:00
close unfinished function to save memory
This commit is contained in:
@@ -438,9 +438,10 @@ class Stash extends EventTarget {
|
||||
subtree: true,
|
||||
})
|
||||
|
||||
const stash = this
|
||||
if (disconnectOnPageChange) {
|
||||
const stash = this
|
||||
function disconnect() {
|
||||
resolve(false)
|
||||
observer.disconnect()
|
||||
stash.removeEventListener("stash:page", disconnect)
|
||||
}
|
||||
@@ -462,9 +463,10 @@ class Stash extends EventTarget {
|
||||
subtree: true,
|
||||
})
|
||||
|
||||
const stash = this
|
||||
if (disconnectOnPageChange) {
|
||||
const stash = this
|
||||
function disconnect() {
|
||||
resolve(false)
|
||||
observer.disconnect()
|
||||
stash.removeEventListener("stash:page", disconnect)
|
||||
}
|
||||
@@ -525,7 +527,7 @@ class Stash extends EventTarget {
|
||||
}
|
||||
}
|
||||
}
|
||||
callback()
|
||||
callback()
|
||||
}
|
||||
_dispatchPageEvent(event, addToHistory = true) {
|
||||
this.dispatchEvent(new CustomEvent(event, {
|
||||
|
||||
Reference in New Issue
Block a user