@opexa/portal-components 0.0.437 → 0.0.438

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.
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useRouter } from 'next/navigation';
3
- import { useCallback, useEffect, useRef } from 'react';
3
+ import { startTransition, useCallback, useEffect, useRef } from 'react';
4
4
  import { toaster } from '../utils/toaster.js';
5
5
  import { useIdle } from './useIdle.js';
6
6
  import { useSessionQuery } from './useSessionQuery.js';
@@ -38,20 +38,19 @@ export function useIdleLogout(timer = DEFAULT_IDLE_TIMER) {
38
38
  if (!isAuthenticated) {
39
39
  return;
40
40
  }
41
- try {
42
- logoutInitiated.current = true;
43
- isLoggingOut.current = true;
44
- localStorage.setItem(IDLE_TIMESTAMP_KEY, Date.now().toString());
45
- signOutMutation.mutate();
46
- toaster.warning({
47
- description: 'You have been logged out due to inactivity.',
48
- });
49
- }
50
- catch (error) {
51
- console.error('Error during idle logout:', error);
52
- isLoggingOut.current = false;
53
- logoutInitiated.current = false;
54
- }
41
+ startTransition(() => {
42
+ try {
43
+ logoutInitiated.current = true;
44
+ isLoggingOut.current = true;
45
+ localStorage.setItem(IDLE_TIMESTAMP_KEY, Date.now().toString());
46
+ signOutMutation.mutate();
47
+ }
48
+ catch (error) {
49
+ console.error('Error during idle logout:', error);
50
+ isLoggingOut.current = false;
51
+ logoutInitiated.current = false;
52
+ }
53
+ });
55
54
  }, [isIdle, sessionQuery.data?.status, signOutMutation]);
56
55
  useEffect(() => {
57
56
  handleIdleLogout();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.437",
3
+ "version": "0.0.438",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",