mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 23:44:56 +03:00
interface: add loaded flag to metadata state
This commit is contained in:
parent
9cc2d07a4e
commit
d36be73933
@ -30,6 +30,7 @@ const associations = (json: MetadataUpdate, state: MetadataState): MetadataState
|
||||
});
|
||||
|
||||
state.associations = metadata;
|
||||
state.loaded = true;
|
||||
}
|
||||
return state;
|
||||
};
|
||||
|
@ -13,6 +13,7 @@ export const METADATA_MAX_PREVIEW_WAIT = 150000;
|
||||
|
||||
export interface MetadataState {
|
||||
associations: Associations;
|
||||
loaded: boolean;
|
||||
getPreview: (group: string) => Promise<MetadataUpdatePreview
|
||||
>;
|
||||
previews: {
|
||||
@ -24,6 +25,7 @@ export interface MetadataState {
|
||||
const useMetadataState = createState<MetadataState>(
|
||||
'Metadata',
|
||||
(set, get) => ({
|
||||
loaded: false,
|
||||
associations: {
|
||||
groups: {},
|
||||
graph: {}
|
||||
@ -53,7 +55,7 @@ const useMetadataState = createState<MetadataState>(
|
||||
}
|
||||
}
|
||||
}),
|
||||
[],
|
||||
['loaded'],
|
||||
[
|
||||
(set, get) =>
|
||||
createSubscription('metadata-store', '/all', (j) => {
|
||||
|
Loading…
Reference in New Issue
Block a user