Skip to content

Commit

Permalink
fix(idea/frontend): program/code add name (#1600)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitayutanov authored Jul 17, 2024
1 parent 970b872 commit 0ca1300
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion idea/frontend/src/hooks/use-add-code-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ function useAddCodeName() {
const alert = useAlert();

return (id: HexString, name: string) =>
isDevChain ? Promise.resolve() : addCodeName(id, name).catch((error) => alert.error(error));
// timeout is gonna be removed in the upcoming indexer update, delay is needed for block data to be indexed
setTimeout(() => {
isDevChain ? Promise.resolve() : addCodeName(id, name).catch((error) => alert.error(error));
}, 2000);
}

export { useAddCodeName };
7 changes: 6 additions & 1 deletion idea/frontend/src/hooks/use-add-program-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ function useAddProgramName() {
const alert = useAlert();

return (id: HexString, name: string) =>
(isDevChain ? addLocalProgramName : addProgramName)(id, name).catch((error) => alert.error(getErrorMessage(error)));
// timeout is gonna be removed in the upcoming indexer update, delay is needed for block data to be indexed
setTimeout(() => {
(isDevChain ? addLocalProgramName : addProgramName)(id, name).catch((error) =>
alert.error(getErrorMessage(error)),
);
}, 2000);
}

export { useAddProgramName };

0 comments on commit 0ca1300

Please sign in to comment.