From 5d0c00ada50bf2dcc17929be7b32843f3a7fa780 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 8 Aug 2024 09:47:20 +0200 Subject: [PATCH] fix(folders): empty content and unknown folder render Signed-off-by: skjnldsv --- src/store/folders.js | 5 +++++ src/views/Folders.vue | 39 +++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/store/folders.js b/src/store/folders.js index efcf4f5da..0d92b7eb8 100644 --- a/src/store/folders.js +++ b/src/store/folders.js @@ -20,6 +20,10 @@ const mutations = { * @param {Array} data.files list of files */ updateFolders(state, { fileid, files }) { + if (!state.folders[fileid]) { + Vue.set(state.folders, fileid, []) + } + if (files.length > 0) { // sort by last modified const list = files @@ -69,6 +73,7 @@ const mutations = { const getters = { folders: state => state.folders, + paths: state => state.paths, folder: state => fileid => state.folders[fileid], folderId: state => path => state.paths[path], } diff --git a/src/views/Folders.vue b/src/views/Folders.vue index e83da3167..aa6891bbb 100644 --- a/src/views/Folders.vue +++ b/src/views/Folders.vue @@ -5,14 +5,16 @@