Unwatch store before destroy
This commit is contained in:
parent
46cd97625d
commit
4149a49807
1 changed files with 11 additions and 2 deletions
|
|
@ -107,7 +107,8 @@ export default {
|
||||||
checkedTags: [],
|
checkedTags: [],
|
||||||
sortDescending: true,
|
sortDescending: true,
|
||||||
galleryFolder: "",
|
galleryFolder: "",
|
||||||
scanTag: "scan"
|
scanTag: "scan",
|
||||||
|
unwatchStoreFunction: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -243,7 +244,7 @@ export default {
|
||||||
|
|
||||||
created: function() {
|
created: function() {
|
||||||
// Watch for host 'ready', then update status
|
// Watch for host 'ready', then update status
|
||||||
this.$store.watch(
|
this.unwatchStoreFunction = this.$store.watch(
|
||||||
(state, getters) => {
|
(state, getters) => {
|
||||||
return getters.ready;
|
return getters.ready;
|
||||||
},
|
},
|
||||||
|
|
@ -259,6 +260,14 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
// Then we call that function here to unwatch
|
||||||
|
if (this.unwatchStoreFunction) {
|
||||||
|
this.unwatchStoreFunction();
|
||||||
|
this.unwatchStoreFunction = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
updateCaptureList: function() {
|
updateCaptureList: function() {
|
||||||
console.log("Updating capture list...");
|
console.log("Updating capture list...");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue