Skip to content

Commit 2eddc22

Browse files
committed
fix: resolve some minor issues
1 parent 2f854f7 commit 2eddc22

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/extension-polkagate/src/fullscreen/accountDetails/components/DisplayBalance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function DisplayBalance ({ amount, decimal, disabled, onClick, op
6464
stroke: `${disabled ? theme.palette.action.disabledBackground : theme.palette.secondary.light}`,
6565
strokeWidth: 1.5,
6666
transform:
67-
openCollapse !== undefined
67+
openCollapse !== undefined || disabled
6868
? openCollapse
6969
? 'rotate(-90deg)'
7070
: 'rotate(90deg)'

packages/extension-polkagate/src/fullscreen/accountDetails/components/ReservedDisplayBalance.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,16 @@ const ReservedDetails = ({ reservedDetails, showReservedDetails }: ReservedDetai
6868
const { t } = useTranslation();
6969
const [stillFetching, setStillFetching] = useState<boolean>(false);
7070

71-
const reasonsToShow = useMemo(() => {
71+
useEffect(() => {
7272
const reasons = Object.values(reservedDetails);
7373

7474
const isStillFetchingSomething = reasons.some((reason) => reason === undefined);
7575

7676
setStillFetching(isStillFetchingSomething);
77+
}, [reservedDetails]);
78+
79+
const reasonsToShow = useMemo(() => {
80+
const reasons = Object.values(reservedDetails);
7781

7882
// details are still fetching
7983
if (reasons.length === 0) {

packages/extension-polkagate/src/hooks/useReservedDetails.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Option, StorageKey } from '@polkadot/types';
55
import type { Balance } from '@polkadot/types/interfaces';
66
// @ts-ignore
77
import type { PalletSocietyBid, PalletSocietyCandidacy } from '@polkadot/types/lookup';
8+
import type { AnyTuple, Codec } from '@polkadot/types-codec/types';
89
import type { Proxy } from '../util/types';
910

1011
import { useCallback, useEffect, useMemo, useState } from 'react';
@@ -14,8 +15,6 @@ import { BN, BN_ZERO } from '@polkadot/util';
1415
import { ASSET_HUBS, PROXY_CHAINS } from '../util/constants';
1516
import useActiveRecoveries from './useActiveRecoveries';
1617
import { useInfo } from '.';
17-
import type { AnyTuple, Codec } from '@polkadot/types-codec/types';
18-
import type { ApiPromise } from '@polkadot/api';
1918

2019
type Item = 'identity' | 'proxy' | 'bounty' | 'recovery' | 'referenda' | 'index' | 'society' | 'multisig' | 'preimage' | 'assets' | 'uniques' | 'NFT';
2120
export type Reserved = { [key in Item]?: Balance | null };
@@ -155,7 +154,7 @@ export default function useReservedDetails (address: string | undefined): Reserv
155154
let referendaDepositSum = BN_ZERO;
156155

157156
api.query['referenda']['referendumInfoFor'].entries().then((referenda) => {
158-
referenda.forEach(([num, value]) => {
157+
referenda.forEach(([_, value]) => {
159158
if (!value.isEmpty) {
160159
// @ts-ignore
161160
const ref = value.toPrimitive() as Referenda;

0 commit comments

Comments
 (0)