Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin0andrey committed May 6, 2024
1 parent 54ae829 commit 87c1f33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/mobile/src/core/TonConnect/TonConnectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ export const TonConnectModal = (props: TonConnectModalProps) => {
const theme = useTheme();
const nav = useNavigation();
const [selectedWalletIdentifier, setSelectedWalletIdentifier] = React.useState<string>(
tk.wallet.isWatchOnly ? tk.walletForUnlock.identifier : tk.wallet.identifier,
tk.wallet.isWatchOnly || tk.wallet.isSigner
? tk.walletForUnlock.identifier
: tk.wallet.identifier,
);
const allWallets = useWallets();
const selectableWallets = useMemo(
() => allWallets.filter((wallet) => !wallet.isWatchOnly),
() => allWallets.filter((wallet) => !wallet.isWatchOnly && !wallet.isSigner),
[allWallets],
);
const wallet = useMemo(
Expand Down
6 changes: 5 additions & 1 deletion packages/shared/modals/AddWalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { useUnlockVault } from '@tonkeeper/mobile/src/core/ModalContainer/NFTOpe
import { getLastEnteredPasscode } from '@tonkeeper/mobile/src/store/wallet/sagas';
import { config } from '@tonkeeper/mobile/src/config';
import { InteractionManager } from 'react-native';
import { walletActions } from '@tonkeeper/mobile/src/store/wallet';
import { useDispatch } from 'react-redux';

interface AddWalletModalProps {
isTonConnect?: boolean;
Expand All @@ -25,6 +27,7 @@ interface AddWalletModalProps {
export const AddWalletModal = memo<AddWalletModalProps>(({ isTonConnect, isImport }) => {
const nav = useNavigation();
const unlockVault = useUnlockVault();
const dispatch = useDispatch();

const handleCreatePress = useCallback(async () => {
if (tk.walletForUnlock) {
Expand Down Expand Up @@ -55,9 +58,10 @@ export const AddWalletModal = memo<AddWalletModalProps>(({ isTonConnect, isImpor
}
} else {
nav.goBack();
dispatch(walletActions.generateVault());
nav.navigate('CreateWalletStack');
}
}, [nav]);
}, [nav, dispatch]);

return (
<Modal>
Expand Down

0 comments on commit 87c1f33

Please sign in to comment.