From 78b962d3972267913db7d02e8dd1c759c0540e5e Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 16 Dec 2022 16:47:42 -0600 Subject: [PATCH] fileStorage/hooks: fix deps on useFileStoragePath This way, if uuid changes, we get the correct result. --- src/fileStorage/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileStorage/hooks.ts b/src/fileStorage/hooks.ts index 40cb36ac..66e9ed6d 100644 --- a/src/fileStorage/hooks.ts +++ b/src/fileStorage/hooks.ts @@ -23,7 +23,7 @@ export function useFileStorageMetadata(): FileMetadata[] | undefined { */ export function useFileStoragePath(uuid: UUID): string | undefined { const db = useContext(FileStorageContext); - return useLiveQuery(() => db.metadata.get(uuid, (x) => x?.path)); + return useLiveQuery(() => db.metadata.get(uuid, (x) => x?.path), [uuid]); } /**