Skip to content

Commit

Permalink
Unflatten SENTRY_UI_STATE object
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Dec 6, 2024
1 parent 6e9e50a commit a0dea86
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions app/scripts/constants/sentry-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,6 @@ export const SENTRY_BACKGROUND_STATE = {
///: END:ONLY_INCLUDE_IF
};

const flattenedBackgroundStateMask = Object.values(
SENTRY_BACKGROUND_STATE,
).reduce((partialBackgroundState, controllerState: object) => {
return {
...partialBackgroundState,
...controllerState,
};
}, {});

// This describes the subset of Redux state attached to errors sent to Sentry
// These properties have some potential to be useful for debugging, and they do
// not contain any identifiable information.
Expand All @@ -428,21 +419,27 @@ export const SENTRY_UI_STATE = {
confirmationExchangeRates: true,
},
metamask: {
...flattenedBackgroundStateMask,
// This property comes from the background but isn't in controller state
isInitialized: true,
useSafeChainsListValidation: true,
watchEthereumAccountEnabled: false,
bitcoinSupportEnabled: false,
bitcoinTestnetSupportEnabled: false,
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
addSnapAccountEnabled: false,
snapsAddSnapAccountModalDismissed: false,
///: END:ONLY_INCLUDE_IF
switchedNetworkDetails: false,
switchedNetworkNeverShowMessage: false,
newPrivacyPolicyToastClickedOrClosed: false,
newPrivacyPolicyToastShownDate: false,
...SENTRY_BACKGROUND_STATE,
PreferencesController: {
...SENTRY_BACKGROUND_STATE.PreferencesController,
useSafeChainsListValidation: true,
watchEthereumAccountEnabled: false,
bitcoinSupportEnabled: false,
bitcoinTestnetSupportEnabled: false,
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
addSnapAccountEnabled: false,
snapsAddSnapAccountModalDismissed: false,
///: END:ONLY_INCLUDE_IF
},
AppStateController: {
...SENTRY_BACKGROUND_STATE.AppStateController,
switchedNetworkDetails: false,
switchedNetworkNeverShowMessage: false,
newPrivacyPolicyToastClickedOrClosed: false,
newPrivacyPolicyToastShownDate: false,
},
},
unconnectedAccount: true,
};

0 comments on commit a0dea86

Please sign in to comment.