From aed5a61f2267fa6e64457b52ac891c4b084b2bc3 Mon Sep 17 00:00:00 2001 From: MickaelK Date: Mon, 27 Nov 2023 00:10:22 +1100 Subject: [PATCH] fix (upload): edge case event will reset cache --- client/helpers/cache.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/helpers/cache.js b/client/helpers/cache.js index 91ff6b49..aec3a568 100644 --- a/client/helpers/cache.js +++ b/client/helpers/cache.js @@ -1,5 +1,6 @@ import { setup_cache_state } from "."; import { currentBackend, currentShare } from "./cache_state.js"; +import Path from "path"; const DB_VERSION = 4; const FILE_PATH = "file_path"; @@ -337,8 +338,9 @@ export function setup_cache() { .then(() => cache.update(FILE_PATH, [currentBackend(), currentShare(), currentPath], (response) => { response.results = response.results.reduce((acc, file) => { if (file.icon === "loading") { - cache.remove(FILE_PATH, [currentBackend(), currentShare(), file.path], false); - cache.remove(FILE_CONTENT, [currentBackend(), currentShare(), file.path], false); + cache.remove(FILE_PATH, [currentBackend(), currentShare(), Path.join(currentPath, "../")], false); + cache.remove(FILE_CONTENT, [currentBackend(), currentShare(), Path.join(currentPath, "../")], false); + cache.remove(FILE_TAG, [currentBackend(), currentShare(), Path.join(currentPath, "../")], false); return acc; } acc.push(file);