From 9462a7443782d9742ebb80fd4adcdd67af148660 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Mon, 22 Nov 2021 01:28:44 +0100 Subject: [PATCH] invalidate local cache when moving dir --- src/components/FileBrowser.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/FileBrowser.tsx b/src/components/FileBrowser.tsx index 118fb6e..a58db4b 100644 --- a/src/components/FileBrowser.tsx +++ b/src/components/FileBrowser.tsx @@ -16,6 +16,7 @@ import { ReactComponent as Spinner } from "./../assets/spinner.svg" import FileBrowserList from "./FileBrowserList" import MoreMenu from "./MoreMenu" import ObjID from "../types/ObjID" +import cache from "../Cache" const FileBrowser: React.FC = (props) => { const path = ObjID.fromURI(props.location.pathname) @@ -86,6 +87,11 @@ const FileBrowser: React.FC = (props) => { if (pasteAction === Action.DirMove && srcID){ await moveDirMutation({variables:{src:srcID,dest:path}}) refetchDir() + + cache.evict({ + id: `Directory:${srcID.toString()}` // TODO: check for a better way to generate cache ids + }) + setSrcID(null) }