mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
fileStorage/hooks: fix deps on useFileStorageUuid
This way if the path changes, we get the correct result.
This commit is contained in:
committed by
David Lechner
parent
78b962d397
commit
0b84b825b6
@@ -33,10 +33,12 @@ export function useFileStoragePath(uuid: UUID): string | undefined {
|
||||
*/
|
||||
export function useFileStorageUuid(path: string): UUID | undefined {
|
||||
const db = useContext(FileStorageContext);
|
||||
return useLiveQuery(() =>
|
||||
db.metadata
|
||||
.where('path')
|
||||
.equals(path)
|
||||
.first((x) => x?.uuid),
|
||||
return useLiveQuery(
|
||||
() =>
|
||||
db.metadata
|
||||
.where('path')
|
||||
.equals(path)
|
||||
.first((x) => x?.uuid),
|
||||
[path],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user