@opexa/portal-components 0.0.393 → 0.0.395

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,7 +57,6 @@ export function useIdleLogout(timer = DEFAULT_IDLE_TIMER) {
57
57
  }
58
58
  return () => {
59
59
  window.removeEventListener('beforeunload', handleUnload);
60
- handleUnload();
61
60
  };
62
61
  }, [sessionQuery.data?.status, signOutMutation, timer]);
63
62
  useEffect(() => {
@@ -3,6 +3,7 @@ import { getQueryClient } from '../../utils/getQueryClient.js';
3
3
  import { getSignOutMutationKey } from '../../utils/mutationKeys.js';
4
4
  import { getSessionQueryKey } from '../../utils/queryKeys.js';
5
5
  import { signOut } from '../services/signOut.js';
6
+ const IDLE_TIMESTAMP_KEY = 'idle-logout-timestamp';
6
7
  export const useSignOutMutation = (config) => {
7
8
  const queryClient = getQueryClient();
8
9
  return useMutation({
@@ -11,7 +12,8 @@ export const useSignOutMutation = (config) => {
11
12
  mutationFn: async () => {
12
13
  await signOut();
13
14
  await queryClient.invalidateQueries({ queryKey: getSessionQueryKey() });
14
- queryClient.clear();
15
+ queryClient.removeQueries();
16
+ localStorage.removeItem(IDLE_TIMESTAMP_KEY);
15
17
  },
16
18
  });
17
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.393",
3
+ "version": "0.0.395",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",