|
@@ -329,13 +329,14 @@ import { mapState, mapGetters, mapActions } from "vuex";
|
|
import draggable from "vuedraggable";
|
|
import draggable from "vuedraggable";
|
|
import Toast from "toasters";
|
|
import Toast from "toasters";
|
|
import ws from "@/ws";
|
|
import ws from "@/ws";
|
|
|
|
+import { mapModalState, mapModalActions } from "@/vuex_helpers";
|
|
|
|
|
|
import SongItem from "../SongItem.vue";
|
|
import SongItem from "../SongItem.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: { SongItem, draggable },
|
|
components: { SongItem, draggable },
|
|
props: {
|
|
props: {
|
|
- sector: { type: String, default: "admin" }
|
|
|
|
|
|
+ modalUuid: { type: String, default: "" }
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -360,27 +361,29 @@ export default {
|
|
computed: {
|
|
computed: {
|
|
playlistSongs: {
|
|
playlistSongs: {
|
|
get() {
|
|
get() {
|
|
- return this.$store.state.modals.importAlbum.playlistSongs;
|
|
|
|
|
|
+ return this.$store.state.modals.importAlbum[this.modalUuid]
|
|
|
|
+ .playlistSongs;
|
|
},
|
|
},
|
|
set(playlistSongs) {
|
|
set(playlistSongs) {
|
|
this.$store.commit(
|
|
this.$store.commit(
|
|
- "modals/importAlbum/updatePlaylistSongs",
|
|
|
|
|
|
+ `modals/importAlbum/${this.modalUuid}/updatePlaylistSongs`,
|
|
playlistSongs
|
|
playlistSongs
|
|
);
|
|
);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
localPrefillDiscogs: {
|
|
localPrefillDiscogs: {
|
|
get() {
|
|
get() {
|
|
- return this.$store.state.modals.importAlbum.prefillDiscogs;
|
|
|
|
|
|
+ return this.$store.state.modals.importAlbum[this.modalUuid]
|
|
|
|
+ .prefillDiscogs;
|
|
},
|
|
},
|
|
set(prefillDiscogs) {
|
|
set(prefillDiscogs) {
|
|
this.$store.commit(
|
|
this.$store.commit(
|
|
- "modals/importAlbum/updatePrefillDiscogs",
|
|
|
|
|
|
+ `modals/importAlbum/${this.modalUuid}/updatePrefillDiscogs`,
|
|
prefillDiscogs
|
|
prefillDiscogs
|
|
);
|
|
);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- ...mapState("modals/importAlbum", {
|
|
|
|
|
|
+ ...mapModalState("modals/importAlbum/MODAL_UUID", {
|
|
discogsTab: state => state.discogsTab,
|
|
discogsTab: state => state.discogsTab,
|
|
discogsAlbum: state => state.discogsAlbum,
|
|
discogsAlbum: state => state.discogsAlbum,
|
|
editingSongs: state => state.editingSongs,
|
|
editingSongs: state => state.editingSongs,
|
|
@@ -405,6 +408,8 @@ export default {
|
|
this.setPlaylistSongs([]);
|
|
this.setPlaylistSongs([]);
|
|
this.showDiscogsTab("search");
|
|
this.showDiscogsTab("search");
|
|
this.socket.dispatch("apis.leaveRoom", "import-album");
|
|
this.socket.dispatch("apis.leaveRoom", "import-album");
|
|
|
|
+ // Delete the VueX module that was created for this modal, after all other cleanup tasks are performed
|
|
|
|
+ this.$store.unregisterModule(["modals", "importAlbum", this.modalUuid]);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
@@ -651,10 +656,13 @@ export default {
|
|
this.$refs[`discogs-${payload}-tab`].scrollIntoView({
|
|
this.$refs[`discogs-${payload}-tab`].scrollIntoView({
|
|
block: "nearest"
|
|
block: "nearest"
|
|
});
|
|
});
|
|
- return dispatch("modals/importAlbum/showDiscogsTab", payload);
|
|
|
|
|
|
+ return dispatch(
|
|
|
|
+ `modals/importAlbum/${this.modalUuid}/showDiscogsTab`,
|
|
|
|
+ payload
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
- ...mapActions("modals/importAlbum", [
|
|
|
|
|
|
+ ...mapModalActions("modals/importAlbum/MODAL_UUID", [
|
|
"toggleDiscogsAlbum",
|
|
"toggleDiscogsAlbum",
|
|
"setPlaylistSongs",
|
|
"setPlaylistSongs",
|
|
"updatePlaylistSongs",
|
|
"updatePlaylistSongs",
|