mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-04-13 05:18:26 -05:00
fix mutation observer disconnect instance
This commit is contained in:
@@ -417,10 +417,11 @@ class Stash extends EventTarget {
|
||||
subtree: true,
|
||||
})
|
||||
|
||||
const stash = this
|
||||
if (disconnectOnPageChange) {
|
||||
function disconnect() {
|
||||
observer.disconnect()
|
||||
this.removeEventListener("page", disconnect)
|
||||
stash.removeEventListener("page", disconnect)
|
||||
}
|
||||
this.addEventListener("page", disconnect)
|
||||
}
|
||||
@@ -440,10 +441,11 @@ class Stash extends EventTarget {
|
||||
subtree: true,
|
||||
})
|
||||
|
||||
const stash = this
|
||||
if (disconnectOnPageChange) {
|
||||
function disconnect() {
|
||||
observer.disconnect()
|
||||
this.removeEventListener("page", disconnect)
|
||||
stash.removeEventListener("page", disconnect)
|
||||
}
|
||||
this.addEventListener("page", disconnect)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user