mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: sync the isVerified state of authed user
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import {
|
||||
useAuthenticatedAccount,
|
||||
useCurrentOrganization,
|
||||
@@ -116,6 +116,14 @@ export function useApplicationBoot() {
|
||||
isBooted.current = true;
|
||||
},
|
||||
);
|
||||
// Reset the loading states once the hook unmount.
|
||||
useEffect(
|
||||
() => () => {
|
||||
isAuthUserLoading && !isBooted.current && stopLoading();
|
||||
isOrgLoading && !isBooted.current && stopLoading();
|
||||
},
|
||||
[isAuthUserLoading, isOrgLoading, stopLoading],
|
||||
);
|
||||
|
||||
return {
|
||||
isLoading: isOrgLoading || isAuthUserLoading,
|
||||
|
||||
Reference in New Issue
Block a user