Skip to content
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

fix: breaking selector due to missing controller state #12375

Merged
merged 8 commits into from
Nov 25, 2024
11 changes: 7 additions & 4 deletions app/selectors/notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ type AuthenticationState =
type UserStorageState = UserStorageController.UserStorageControllerState;

const selectAuthenticationControllerState = (state: RootState) =>
state?.engine?.backgroundState?.AuthenticationController;
state?.engine?.backgroundState?.AuthenticationController ??
AuthenticationController.defaultState;

const selectUserStorageControllerState = (state: RootState) =>
state?.engine?.backgroundState?.UserStorageController;
state?.engine?.backgroundState?.UserStorageController ??
UserStorageController.defaultState;
Prithpal-Sooriya marked this conversation as resolved.
Show resolved Hide resolved

const selectNotificationServicesControllerState = (state: RootState) =>
state?.engine?.backgroundState?.NotificationServicesController;
state?.engine?.backgroundState?.NotificationServicesController ??
NotificationServicesController.defaultState;

export const selectIsProfileSyncingEnabled = createSelector(
selectUserStorageControllerState,
(userStorageControllerState: UserStorageState) =>
userStorageControllerState.isProfileSyncingEnabled,
userStorageControllerState?.isProfileSyncingEnabled,
Prithpal-Sooriya marked this conversation as resolved.
Show resolved Hide resolved
);
export const selectIsProfileSyncingUpdateLoading = createSelector(
selectUserStorageControllerState,
Expand Down
Loading