fix loading indicator for traversing warrens

This commit is contained in:
2025-07-18 14:45:21 +02:00
parent 4c3e54daca
commit 48cbd532c2
4 changed files with 33 additions and 16 deletions

View File

@@ -6,16 +6,16 @@ export const useWarrenStore = defineStore('warrens', {
state: () => ({
warrens: {} as Record<string, Warren>,
current: null as { warrenId: string; path: string } | null,
loading: false,
}),
actions: {
async setCurrentWarren(warrenId: string, path: string) {
setCurrentWarren(warrenId: string, path: string) {
this.current = {
warrenId,
path,
};
await refreshNuxtData('current-directory');
},
async addToCurrentWarrenPath(path: string) {
addToCurrentWarrenPath(path: string) {
if (this.current == null) {
return;
}
@@ -25,9 +25,8 @@ export const useWarrenStore = defineStore('warrens', {
}
this.current.path += path;
await refreshNuxtData('current-directory');
},
async setCurrentWarrenPath(path: string) {
setCurrentWarrenPath(path: string) {
if (this.current == null) {
return;
}
@@ -37,7 +36,6 @@ export const useWarrenStore = defineStore('warrens', {
}
this.current.path = path;
await refreshNuxtData('current-directory');
},
clearCurrentWarren() {
this.current = null;