mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 13:03:02 +00:00
try adding playlists list to context menu - unsuccsessfully
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
enum ModalOptions {
|
||||
newPlaylist = "newPlaylist",
|
||||
editPlaylist = "editPlaylist",
|
||||
}
|
||||
|
||||
export default defineStore("newModal", {
|
||||
state: () => ({
|
||||
title: "",
|
||||
options: ModalOptions,
|
||||
component: "",
|
||||
visible: false,
|
||||
}),
|
||||
actions: {
|
||||
showModal(modalOption: string) {
|
||||
this.component = modalOption;
|
||||
this.visible = true;
|
||||
},
|
||||
hideModal() {
|
||||
this.visible = false;
|
||||
},
|
||||
setTitle(new_title: string) {
|
||||
this.title = new_title;
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
const useNotificationStore = defineStore("notification", {
|
||||
state: () => ({
|
||||
text: "",
|
||||
visible: false,
|
||||
}),
|
||||
actions: {
|
||||
showNotification(new_text: string) {
|
||||
this.text = new_text;
|
||||
this.visible = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.visible = false;
|
||||
}, 2000);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
class Notification {
|
||||
constructor(text: string) {
|
||||
useNotificationStore().showNotification(text);
|
||||
}
|
||||
}
|
||||
|
||||
export { useNotificationStore, Notification };
|
||||
@@ -0,0 +1,14 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { Playlist } from "../interfaces";
|
||||
import { getAllPlaylists } from "../composables/playlists";
|
||||
|
||||
export default defineStore("playlists", {
|
||||
state: () => ({
|
||||
playlists: <Playlist[]>[],
|
||||
}),
|
||||
actions: {
|
||||
fetchAll() {
|
||||
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user