mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
fileStorage/hooks: fix deps on useFileStoragePath
This way, if uuid changes, we get the correct result.
This commit is contained in:
committed by
David Lechner
parent
b38c302d7a
commit
78b962d397
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user