Skip to content

Commit

Permalink
fixes modal status switchchain-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nijoe1 committed Oct 17, 2024
1 parent 7569360 commit 63b6e2d
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const useAttestationStatus = (
const requiresSwitch = chainId !== userChainID;

const initialStatus = useMemo(() => {
return requiresSwitch
? ProgressStatus.SWITCH_CHAIN
: isHistoryPage
? ProgressStatus.SELECTING_COLOR
return isHistoryPage
? ProgressStatus.SELECTING_COLOR
: requiresSwitch
? ProgressStatus.SWITCH_CHAIN
: ProgressStatus.NOT_STARTED;
}, [requiresSwitch, isHistoryPage]);

Expand All @@ -28,7 +28,10 @@ export const useAttestationStatus = (
};

return {
status: requiresSwitch ? ProgressStatus.SWITCH_CHAIN : status,
status:
requiresSwitch && status === ProgressStatus.NOT_STARTED
? ProgressStatus.SWITCH_CHAIN
: status,
updateStatus,
};
};

0 comments on commit 63b6e2d

Please sign in to comment.