Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 1cbf553

Browse files
committed
check for specific err code
1 parent 5e7613d commit 1cbf553

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ts/pages/account/dashboard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ interface PoolDetails {
100100
zrxAmount: number;
101101
}
102102

103+
interface RPCError {
104+
code: number;
105+
message: string;
106+
}
107+
103108
interface ExpectedPoolRewards {
104109
[poolId: string]: BigNumber;
105110
}
@@ -397,7 +402,8 @@ export const Account: React.FC<AccountProps> = () => {
397402
}, [currentEpochStakeMap, nextEpochStakeMap, delegatorData]);
398403

399404
React.useEffect(() => {
400-
if (useStakeError) {
405+
const castedStakeError = useStakeError as unknown as RPCError;
406+
if (useStakeError && castedStakeError.code === -32000) {
401407
setStakingError(useStakeError);
402408
}
403409
}, [useStakeError]);

0 commit comments

Comments
 (0)