mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
mpy/alerts: implement compiler error
This shows the output from mpy-cross and has a button to go to the error.
This commit is contained in:
committed by
David Lechner
parent
e5ab52b250
commit
7e726fffaf
@@ -25,3 +25,18 @@ export function useFileStoragePath(uuid: UUID): string | undefined {
|
||||
const db = useContext(FileStorageContext);
|
||||
return useLiveQuery(() => db.metadata.get(uuid, (x) => x?.path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file path for a file UUID.
|
||||
*
|
||||
* If the file is renamed, the returned value will be automatically updated.
|
||||
*/
|
||||
export function useFileStorageUuid(path: string): UUID | undefined {
|
||||
const db = useContext(FileStorageContext);
|
||||
return useLiveQuery(() =>
|
||||
db.metadata
|
||||
.where('path')
|
||||
.equals(path)
|
||||
.first((x) => x?.uuid),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user