-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Dojo.js Version
1.7.0-preview.3
What happened?
Entities are being returned as undefined in the waitForEntityChange.
I can see it is triggering and the correct event is being recorded in the subscription. The platformMetricsEntityId also looks correct.
If this could be looked into as a priority that would be greatly appreciated.
What is the expected behavior?
Should be returning the entity in the callback so we can detect when a tx has completed.
console.log(entity) returns undefined
Steps to reproduce
export const useDojoStore: DojoStoreHook<SchemaType> =
createDojoStore<SchemaType>();
const state = useDojoStore((state) => state);
const waitForTournamentCreation = async (totalTournaments: number) => {
const platformMetricsEntityId = getEntityIdFromKeys([
BigInt(TOURNAMENT_VERSION_KEY),
]);
await state.waitForEntityChange(
platformMetricsEntityId,
(entity) => {
console.log(entity);
return (
entity?.models?.[namespace]?.PlatformMetrics?.total_tournaments ==
Number(totalTournaments)
);
},
20000
);
};
Trace
No response
Is there an existing issue for this?
- I have searched the existing issues and verified no issue exits for this problem.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working