major refactors

This commit is contained in:
geoffrey45
2022-03-30 14:56:40 +03:00
parent 1a19fb61cd
commit 0c1e792839
21 changed files with 164 additions and 322 deletions
+21
View File
@@ -0,0 +1,21 @@
import { defineStore } from "pinia";
import { Folder, Track } from "../interfaces";
import fetchThem from "../composables/getFilesAndFolders";
export default defineStore("FolderDirs&Tracks", {
state: () => ({
path: <string>{},
dirs: <Folder[]>[],
tracks: <Track[]>[],
}),
actions: {
async fetchAll(path: string) {
const { tracks, folders } = await fetchThem(path);
this.path = path;
this.dirs = folders;
this.tracks = tracks;
},
},
});
+2 -2
View File
@@ -1,8 +1,8 @@
import { defineStore } from "pinia";
import { Track } from "../interfaces";
enum ModalOptions {
newPlaylist = "newPlaylist",
editPlaylist = "editPlaylist",
newPlaylist,
editPlaylist,
}
export default defineStore("newModal", {