@bevel-software/platform-core-frontend 0.24.0 → 0.25.2
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bevel-software/platform-core-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"description": "Open-source core UI of the Bevel platform (raw TS/TSX source): workspace explorer/viewer, branches & change requests, Library, secrets, tools, access control.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tailwind-merge": "^3.5.0",
|
|
46
46
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|
|
47
47
|
"yaml": "^2.9.0",
|
|
48
|
-
"@bevel-software/platform-shared": "0.
|
|
48
|
+
"@bevel-software/platform-shared": "0.25.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useRef, useState, type ReactNode } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react';
|
|
2
2
|
import { cn } from '../../../lib/utils';
|
|
3
3
|
import { toastDuration } from '../utils/toast-duration';
|
|
4
4
|
import { ToastContext, type ShowToast, type ToastTone } from './toast.context';
|
|
@@ -43,6 +43,14 @@ export function LibraryToastProvider({ children }: { children: ReactNode }) {
|
|
|
43
43
|
visible: boolean;
|
|
44
44
|
} | null>(null);
|
|
45
45
|
const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
46
|
+
// A toast still on screen when the provider goes away has a timer left to
|
|
47
|
+
// run, which would then set state on something that is no longer there.
|
|
48
|
+
useEffect(
|
|
49
|
+
() => () => {
|
|
50
|
+
if (timer.current) clearTimeout(timer.current);
|
|
51
|
+
},
|
|
52
|
+
[],
|
|
53
|
+
);
|
|
46
54
|
|
|
47
55
|
const show = useCallback<ShowToast>((msg, tone = 'neutral') => {
|
|
48
56
|
setToast({ message: msg, tone, visible: true });
|