Skip to content

Commit

Permalink
fix type instead of desconstruct deviceMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini committed Feb 23, 2024
1 parent c14f660 commit 829882a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/components/Views/RestoreWallet/RestoreWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ const RestoreWallet = () => {

const handleOnNext = useCallback(async (): Promise<void> => {
setLoading(true);

trackEvent(
MetaMetricsEvents.VAULT_CORRUPTION_RESTORE_WALLET_BUTTON_PRESSED,
{ ...deviceMetaData },
deviceMetaData,
);
const restoreResult = await EngineService.initializeVaultFromBackup();
if (restoreResult.success) {
Expand Down
6 changes: 3 additions & 3 deletions app/components/Views/RestoreWallet/WalletResetNeeded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ const WalletResetNeeded = () => {
useEffect(() => {
trackEvent(
MetaMetricsEvents.VAULT_CORRUPTION_WALLET_RESET_NEEDED_SCREEN_VIEWED,
{ ...deviceMetaData },
deviceMetaData,
);
}, [trackEvent, deviceMetaData]);

const handleCreateNewWallet = useCallback(async () => {
trackEvent(
MetaMetricsEvents.VAULT_CORRUPTION_WALLET_RESET_NEEDED_CREATE_NEW_WALLET_BUTTON_PRESSED,
{ ...deviceMetaData },
deviceMetaData,
);
navigation.navigate(Routes.MODAL.ROOT_MODAL_FLOW, {
screen: Routes.MODAL.DELETE_WALLET,
Expand All @@ -54,7 +54,7 @@ const WalletResetNeeded = () => {
const handleTryAgain = useCallback(async () => {
trackEvent(
MetaMetricsEvents.VAULT_CORRUPTION_WALLET_RESET_NEEDED_TRY_AGAIN_BUTTON_PRESSED,
{ ...deviceMetaData },
deviceMetaData,
);
navigation.replace(
...createRestoreWalletNavDetails({
Expand Down
4 changes: 2 additions & 2 deletions app/components/Views/RestoreWallet/WalletRestored.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const WalletRestored = () => {
useEffect(() => {
trackEvent(
MetaMetricsEvents.VAULT_CORRUPTION_WALLET_SUCCESSFULLY_RESTORED_SCREEN_VIEWED,
{ ...deviceMetaData },
deviceMetaData,
);
}, [deviceMetaData, trackEvent]);

Expand All @@ -72,7 +72,7 @@ const WalletRestored = () => {
setLoading(true);
trackEvent(
MetaMetricsEvents.VAULT_CORRUPTION_WALLET_SUCCESSFULLY_RESTORED_CONTINUE_BUTTON_PRESSED,
{ ...deviceMetaData },
deviceMetaData,
);
await finishWalletRestore();
}, [deviceMetaData, finishWalletRestore, trackEvent]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export interface DeviceMetaData {
interface AnalyticsProperties {
[key: string]: string;
}
export interface DeviceMetaData extends AnalyticsProperties {
platform: string;
currentBuildNumber: string;
applicationVersion: string;
Expand Down

0 comments on commit 829882a

Please sign in to comment.