Add notification for no spool assigned for active trays, improve usage tracker logic in edge cases (#789)

Add notification for no spool assigned for active trays, improve usage tracker logic in edge cases (#789)
This commit is contained in:
Keybored
2026-03-24 11:31:32 +01:00
committed by GitHub
parent dd75c8f0c9
commit 3f7d0e2d55
28 changed files with 726 additions and 70 deletions
+4 -1
View File
@@ -6,6 +6,8 @@ import { formatFileSize } from '../utils/file';
type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
type ShowPersistentToast = (id: string, message: string, type?: ToastType) => void;
interface Toast {
id: string;
message: string;
@@ -38,7 +40,7 @@ interface DispatchToastData {
interface ToastContextType {
showToast: (message: string, type?: ToastType) => void;
showPersistentToast: (id: string, message: string, type?: ToastType) => void;
showPersistentToast: ShowPersistentToast;
dismissToast: (id: string) => void;
}
@@ -460,6 +462,7 @@ export function ToastProvider({ children }: { children: ReactNode }) {
return () => window.removeEventListener('background-dispatch', onDispatchEvent);
}, [t]);
return (
<ToastContext.Provider value={{ showToast, showPersistentToast, dismissToast }}>
{children}