Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
made library not create dupe listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
amydevs committed Jan 3, 2022
1 parent 0f031af commit 9500f68
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/views/Library.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,23 @@
},
data() {
return {
charts: [] as Chart[]
charts: [] as Chart[],
delFunc: null as null | (() => void),
}
},
async mounted() {
window.electron.ipc.receive("library-update", (event:Chart[]) => {
this.charts = event;
mounted() {
this.delFunc = window.electron.ipc.receive("library-update", (event:Chart[]) => {
console.log(event)
this.charts = event;
});
this.charts = window.electron.library.get();
},
beforeDestroy() {
if (this.delFunc) {
this.delFunc();
}
},
methods: {
}
})
</script>

0 comments on commit 9500f68

Please sign in to comment.