Skip to content

Commit

Permalink
fix: don’t crash on sign out (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber authored Jun 21, 2024
1 parent 2facefe commit 8ae7d06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev-client/src/hooks/userDeletionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const useUserDeletionRequests = () => {
const dispatch = useDispatch();
const {data: user} = useSelector(state => state.account.currentUser);
const isSaving = useSelector(state => state.account.preferences.saving);
const isPending = user!.preferences[PREFERENCES_KEY] === PREFERENCES_VALUE;
const isPending = user?.preferences[PREFERENCES_KEY] === PREFERENCES_VALUE;

const requestDeletion = useCallback(() => {
dispatch(savePreference({key: PREFERENCES_KEY, value: PREFERENCES_VALUE}));
Expand Down

0 comments on commit 8ae7d06

Please sign in to comment.