Skip to content

Commit

Permalink
prevent auto pin from running multiple times, remove total balance text
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbbb committed Dec 20, 2024
1 parent a3b285b commit c534b4a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/screens/change-wallet/ChangeWalletSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export default function ChangeWalletSheet() {
const walletsWithBalancesAndNames = useWalletsWithBalancesAndNames();

const initialHasShownEditHintTooltip = useMemo(() => usePinnedWalletsStore.getState().hasShownEditHintTooltip, []);
const initialHasAutoPinnedAddresses = useMemo(() => usePinnedWalletsStore.getState().hasAutoPinnedAddresses, []);
const initialPinnedAddressCount = useMemo(() => usePinnedWalletsStore.getState().pinnedAddresses.length, []);
const { transactionCounts, isLoading: isLoadingTransactionCounts } = useWalletTransactionCounts(wallets || {});
const hasAutoPinnedAddresses = usePinnedWalletsStore(state => state.hasAutoPinnedAddresses);

const featureHintTooltipRef = useRef<TooltipRef>(null);

Expand Down Expand Up @@ -164,7 +164,7 @@ export default function ChangeWalletSheet() {

// If user has never seen pinned addresses feature, auto-pin the users most used owned addresses
useEffect(() => {
if (initialHasAutoPinnedAddresses || initialPinnedAddressCount > 0 || isLoadingTransactionCounts) return;
if (hasAutoPinnedAddresses || initialPinnedAddressCount > 0 || isLoadingTransactionCounts) return;

const pinnableAddresses = allWalletItems.filter(item => !item.isReadOnly).map(item => item.address);

Expand All @@ -179,7 +179,7 @@ export default function ChangeWalletSheet() {
}, [
allWalletItems,
setPinnedAddresses,
initialHasAutoPinnedAddresses,
hasAutoPinnedAddresses,
initialPinnedAddressCount,
transactionCounts,
isLoadingTransactionCounts,
Expand Down Expand Up @@ -706,7 +706,8 @@ export default function ChangeWalletSheet() {
paddingHorizontal={{ custom: PANEL_INSET_HORIZONTAL }}
paddingTop="24px"
>
{!editMode && ownedWalletsTotalBalance ? (
{/* TODO: enable when blurview is implemented */}
{/* {!editMode && ownedWalletsTotalBalance ? (
<Stack space="10px">
<Text color="labelSecondary" size="13pt" weight="bold">
{i18n.t(i18n.l.wallet.change_wallet.total_balance)}
Expand All @@ -717,7 +718,8 @@ export default function ChangeWalletSheet() {
</Stack>
) : (
<Box />
)}
)} */}
<Box />
<ButtonPressAnimation onPress={onPressAddAnotherWallet}>
<Box
background="blue"
Expand Down

0 comments on commit c534b4a

Please sign in to comment.