Skip to content

Commit b1d4c8b

Browse files
committed
fix: useAction loading set state order
1 parent a2bfe2b commit b1d4c8b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/blinks-core/src/hooks/useAction.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function useActionApiUrl(url: string | URL) {
2626
if (ignore) {
2727
return;
2828
}
29+
setIsLoading(false);
2930
setApiUrl(apiUrl);
3031
})
3132
.catch((e) => {
@@ -72,6 +73,7 @@ export function useAction({
7273
Action.fetch(actionApiUrl, supportStrategy)
7374
.then((action) => {
7475
if (!ignore) {
76+
setIsLoading(false);
7577
setAction(action);
7678
setHasFetched(true);
7779
}

0 commit comments

Comments
 (0)