mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 07:52:59 +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.associations = metadata;
|
||||||
|
state.loaded = true;
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,7 @@ export const METADATA_MAX_PREVIEW_WAIT = 150000;
|
|||||||
|
|
||||||
export interface MetadataState {
|
export interface MetadataState {
|
||||||
associations: Associations;
|
associations: Associations;
|
||||||
|
loaded: boolean;
|
||||||
getPreview: (group: string) => Promise<MetadataUpdatePreview
|
getPreview: (group: string) => Promise<MetadataUpdatePreview
|
||||||
>;
|
>;
|
||||||
previews: {
|
previews: {
|
||||||
@ -24,6 +25,7 @@ export interface MetadataState {
|
|||||||
const useMetadataState = createState<MetadataState>(
|
const useMetadataState = createState<MetadataState>(
|
||||||
'Metadata',
|
'Metadata',
|
||||||
(set, get) => ({
|
(set, get) => ({
|
||||||
|
loaded: false,
|
||||||
associations: {
|
associations: {
|
||||||
groups: {},
|
groups: {},
|
||||||
graph: {}
|
graph: {}
|
||||||
@ -53,7 +55,7 @@ const useMetadataState = createState<MetadataState>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
[],
|
['loaded'],
|
||||||
[
|
[
|
||||||
(set, get) =>
|
(set, get) =>
|
||||||
createSubscription('metadata-store', '/all', (j) => {
|
createSubscription('metadata-store', '/all', (j) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user