-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wallet-mobile): wallet open after create/restore
- Loading branch information
1 parent
89ea130
commit f6a108d
Showing
41 changed files
with
423 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ COMMIT=093dec95a | |
BUILD_VARIANT=STAGING | ||
SENTRY_DSN=https://[email protected]/4505319746764800 | ||
|
||
DISABLE_LOGBOX=true | ||
DISABLE_LOGBOX=false | ||
|
||
WALLET_1_MNEMONIC=abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon address | ||
WALLET_1_NETWORK_ID=300 | ||
|
@@ -20,3 +20,5 @@ FRONTEND_FEE_ADDRESS_MAINNET=addr1q9ry6jfdgm0lcrtfpgwrgxg7qfahv80jlghhrthy6w8hmy | |
FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km | ||
|
||
UNSTOPPABLE_API_KEY=czsajliz-wxgu6tujd1zqq7hey_pclfqhdjsqolsxjfsurgh | ||
|
||
LOGGER_FILTER= |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
apps/wallet-mobile/src/features/SetupWallet/common/PreparingWallet/PreparingWallet.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...et-mobile/src/features/SetupWallet/common/PreparingWalletScreen/PreparingWalletScreen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import {useSetupWallet} from '@yoroi/setup-wallet' | ||
import {useTheme} from '@yoroi/theme' | ||
import * as React from 'react' | ||
import {StyleSheet, Text} from 'react-native' | ||
import {SafeAreaView} from 'react-native-safe-area-context' | ||
|
||
import {logger} from '../../../../kernel/logger/logger' | ||
import {isEmptyString} from '../../../../kernel/utils' | ||
import {useLaunchWalletAfterSyncing} from '../../../WalletManager/common/useLaunchWalletAfterSyncing' | ||
import {useSyncTemporarilyPaused} from '../../../WalletManager/common/useSyncTemporarilyPaused' | ||
import {useStrings} from '../useStrings' | ||
|
||
/** | ||
* It requests the global syncing to stop on mounting to favor the sync of a specific wallet | ||
* and resume the global syncing after the wallet is sync and the screen is unmounted. | ||
*/ | ||
export const PreparingWalletScreen = () => { | ||
const strings = useStrings() | ||
const {styles} = useStyles() | ||
const {walletId} = useSetupWallet() | ||
const isGlobalSyncPaused = useSyncTemporarilyPaused() | ||
useLaunchWalletAfterSyncing({isGlobalSyncPaused, walletId}) | ||
|
||
if (isEmptyString(walletId)) { | ||
const error = new Error('PreparingWalletScreen: walletId is empty, reached an invalid state.') | ||
logger.error(error) | ||
throw error | ||
} | ||
|
||
return ( | ||
<SafeAreaView edges={['left', 'right', 'bottom', 'top']} style={styles.root}> | ||
<Text style={styles.title}>{strings.preparingWallet}</Text> | ||
</SafeAreaView> | ||
) | ||
} | ||
|
||
const useStyles = () => { | ||
const {atoms, color} = useTheme() | ||
const styles = StyleSheet.create({ | ||
root: { | ||
...atoms.flex_1, | ||
...atoms.align_center, | ||
...atoms.justify_center, | ||
}, | ||
title: { | ||
color: color.primary_c500, | ||
...atoms.text_center, | ||
...atoms.heading_2_medium, | ||
}, | ||
}) | ||
return {styles} as const | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.