fix (upload): edge case event will reset cache

This commit is contained in:
MickaelK 2023-11-27 00:10:22 +11:00
parent 2e54875c92
commit aed5a61f22

View file

@ -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);