-
Notifications
You must be signed in to change notification settings - Fork 277
Sam/optimize initialize account #5858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
40469e9
a2f01c1
ef8907b
099640c
f86ab08
1f94725
4af7d28
e1c6722
e664176
5d92708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,14 +118,14 @@ export function initializeAccount( | |
| 'createWalletSelectCrypto' | 'createWalletSelectCryptoNewAccount' | ||
| >['navigation'], | ||
| items: WalletCreateItem[] | ||
| ) => { | ||
| ): Promise<void> => { | ||
| navigation.replace('edgeTabs', { screen: 'home' }) | ||
| const createWalletsPromise = createCustomWallets( | ||
| account, | ||
| fiatCurrencyCode, | ||
| items, | ||
| dispatch | ||
| ).catch(error => { | ||
| ).catch((error: unknown) => { | ||
| showError(error) | ||
| }) | ||
|
|
||
|
|
@@ -222,12 +222,12 @@ export function initializeAccount( | |
| const { userSettings = {} } = currencyConfig | ||
| currencyConfig | ||
| .changeUserSettings(userSettings) | ||
| .catch((error: unknown) => { | ||
| showError(error) | ||
| .catch((err: unknown) => { | ||
| showError(err) | ||
| }) | ||
| } | ||
| }) | ||
| .catch(err => { | ||
| .catch((err: unknown) => { | ||
| showError(err) | ||
| }) | ||
| } | ||
|
|
@@ -245,7 +245,7 @@ export function initializeAccount( | |
| const { context } = state.core | ||
|
|
||
| // Sign up for push notifications: | ||
| dispatch(registerNotificationsV2()).catch(e => { | ||
| dispatch(registerNotificationsV2()).catch((e: unknown) => { | ||
| console.error(e) | ||
| }) | ||
|
|
||
|
|
@@ -292,13 +292,13 @@ export function initializeAccount( | |
| const mergedDenominationSettings = {} | ||
|
|
||
| for (const plugin of Object.keys(defaultDenominationSettings)) { | ||
| // @ts-expect-error | ||
| // @ts-expect-error - Dynamic object property assignment for denomination merging | ||
|
||
| mergedDenominationSettings[plugin] = {} | ||
| // @ts-expect-error | ||
| // @ts-expect-error - Dynamic object property access for denomination merging | ||
|
||
| for (const code of Object.keys(defaultDenominationSettings[plugin])) { | ||
| // @ts-expect-error | ||
| // @ts-expect-error - Dynamic object property assignment for denomination merging | ||
| mergedDenominationSettings[plugin][code] = { | ||
| // @ts-expect-error | ||
| // @ts-expect-error - Dynamic object property access for denomination merging | ||
|
||
| ...defaultDenominationSettings[plugin][code], | ||
| ...(syncedDenominationSettings?.[plugin]?.[code] ?? {}) | ||
| } | ||
|
|
@@ -324,7 +324,7 @@ export function initializeAccount( | |
| }, | ||
| onNotificationPermit(info) { | ||
| dispatch(updateNotificationSettings(info.notificationOptIns)).catch( | ||
| error => { | ||
| (error: unknown) => { | ||
| trackError(error, 'LoginScene:onLogin:setDeviceSettings') | ||
| console.error(error) | ||
| } | ||
|
|
@@ -430,7 +430,7 @@ async function createCustomWallets( | |
| account.createCurrencyWallets(options), | ||
| timeoutMs, | ||
| new Error(lstrings.error_creating_wallets) | ||
| ).catch(error => { | ||
| ).catch((error: unknown) => { | ||
| dispatch(logEvent('Signup_Wallets_Created_Failed', { error })) | ||
| throw error | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,12 +114,14 @@ export const readReviewTriggerData = async ( | |
| // Initialize new data structure with old swap count data | ||
| const migratedData: ReviewTriggerData = { | ||
| ...initReviewTriggerData(), | ||
| swapCount: parseInt(swapCountData.swapCount) || 0 | ||
| swapCount: Number.isNaN(parseInt(swapCountData.swapCount)) | ||
| ? 0 | ||
| : parseInt(swapCountData.swapCount) | ||
|
||
| } | ||
|
|
||
| // If user was already asked for review in the old system, | ||
| // set nextTriggerDate to 1 year in the future | ||
| if (swapCountData.hasReviewBeenRequested) { | ||
| if (swapCountData.hasReviewBeenRequested === true) { | ||
| const nextYear = new Date() | ||
| nextYear.setFullYear(nextYear.getFullYear() + 1) | ||
| migratedData.nextTriggerDate = nextYear | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ import { EdgeText } from '../themed/EdgeText' | |
|
|
||
| interface Props extends EdgeSceneProps<'reviewTriggerTest'> {} | ||
|
|
||
| export const ReviewTriggerTestScene = (props: Props) => { | ||
| export const ReviewTriggerTestScene = (props: Props): React.JSX.Element => { | ||
|
||
| const dispatch = useDispatch() | ||
| const theme = useTheme() | ||
| const styles = getStyles(theme) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ import { WalletListSwipeable } from '../themed/WalletListSwipeable' | |
|
|
||
| interface Props extends WalletsTabSceneProps<'walletList'> {} | ||
|
|
||
| export function WalletListScene(props: Props) { | ||
| export function WalletListScene(props: Props): React.JSX.Element { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be |
||
| const { navigation } = props | ||
| const theme = useTheme() | ||
| const styles = getStyles(theme) | ||
|
|
@@ -77,7 +77,7 @@ export function WalletListScene(props: Props) { | |
| setSorting(true) | ||
| } | ||
| }) | ||
| .catch(error => { | ||
| .catch((error: unknown) => { | ||
| showError(error) | ||
| }) | ||
| }) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why rename this? If we had to standardize on one name, I would prefer "error" over "err" or "e".