|
@@ -172,6 +172,7 @@ import { mapState, mapActions, mapGetters } from "vuex";
|
|
import { defineAsyncComponent } from "vue";
|
|
import { defineAsyncComponent } from "vue";
|
|
|
|
|
|
import Toast from "toasters";
|
|
import Toast from "toasters";
|
|
|
|
+import { mapModalState, mapModalActions } from "@/vuex_helpers";
|
|
|
|
|
|
import SongItem from "@/components/SongItem.vue";
|
|
import SongItem from "@/components/SongItem.vue";
|
|
|
|
|
|
@@ -182,7 +183,9 @@ export default {
|
|
),
|
|
),
|
|
SongItem
|
|
SongItem
|
|
},
|
|
},
|
|
- props: {},
|
|
|
|
|
|
+ props: {
|
|
|
|
+ modalUuid: { type: String, default: "" }
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
items: [],
|
|
items: [],
|
|
@@ -220,7 +223,7 @@ export default {
|
|
item => item.song._id === this.currentSong._id
|
|
item => item.song._id === this.currentSong._id
|
|
)?.flagged;
|
|
)?.flagged;
|
|
},
|
|
},
|
|
- ...mapState("modals/editSongs", {
|
|
|
|
|
|
+ ...mapModalState("modals/editSongs/MODAL_UUID", {
|
|
songIds: state => state.songIds,
|
|
songIds: state => state.songIds,
|
|
songPrefillData: state => state.songPrefillData
|
|
songPrefillData: state => state.songPrefillData
|
|
}),
|
|
}),
|
|
@@ -269,7 +272,9 @@ export default {
|
|
},
|
|
},
|
|
beforeUnmount() {
|
|
beforeUnmount() {
|
|
this.socket.dispatch("apis.leaveRoom", "edit-songs");
|
|
this.socket.dispatch("apis.leaveRoom", "edit-songs");
|
|
- this.resetSongs();
|
|
|
|
|
|
+ // this.resetSongs();
|
|
|
|
+ // Delete the VueX module that was created for this modal, after all other cleanup tasks are performed
|
|
|
|
+ this.$store.unregisterModule(["modals", "editSongs", this.modalUuid]);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
pickSong(song) {
|
|
pickSong(song) {
|
|
@@ -404,11 +409,11 @@ export default {
|
|
else this.closeThisModal();
|
|
else this.closeThisModal();
|
|
},
|
|
},
|
|
closeThisModal() {
|
|
closeThisModal() {
|
|
- this.closeModal("editSongs");
|
|
|
|
|
|
+ this.closeCurrentModal();
|
|
},
|
|
},
|
|
- ...mapActions("modalVisibility", ["openModal", "closeModal"]),
|
|
|
|
|
|
+ ...mapActions("modalVisibility", ["openModal", "closeCurrentModal"]),
|
|
...mapActions("modals/editSong", ["editSong"]),
|
|
...mapActions("modals/editSong", ["editSong"]),
|
|
- ...mapActions("modals/editSongs", ["resetSongs"])
|
|
|
|
|
|
+ ...mapModalActions("modals/editSongs/MODAL_UUID", ["resetSongs"])
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|