Skip to content

Commit

Permalink
fix: loading state added
Browse files Browse the repository at this point in the history
  • Loading branch information
borkopetrovicc committed Jun 15, 2023
1 parent a9a24ca commit 1cd4df1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stores/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export async function logout() {
activePayment: null,
customerConsents: null,
publisherConsents: null,
loading: false,
});

await restoreFavorites();
Expand All @@ -168,7 +169,7 @@ export async function logout() {

export const register = async (email: string, password: string) => {
await useService(async ({ accountService, accessModel, config }) => {
useAccountStore.setState({ loading: true });
useAccountStore.setState({ customerConsents: null });
const response = await accountService.register({ config, email, password });
if (response) {
const { user, customerConsents } = response;
Expand Down

0 comments on commit 1cd4df1

Please sign in to comment.