Skip to content

Commit

Permalink
Update src/stores/AccountController.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Danny Budzinski <[email protected]>
  • Loading branch information
darkoatanasovski and dbudzins authored Dec 7, 2022
1 parent 18ebe19 commit b88601e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export async function updateUser(values: { firstName: string; lastName: string }
await withAccountService(async ({ accountService, sandbox }) => {
useAccountStore.setState({ loading: true });

const { auth, user } = useAccountStore.getState();
const { auth, user, canUpdateEmail } = useAccountStore.getState();

if (values.email && !canUpdateEmail) {
throw new Error('Email update not supported');
}

if (!auth || !user) throw new Error('no auth');

Expand Down

0 comments on commit b88601e

Please sign in to comment.