Files
GPI/src/client/utils/toastHandler.ts
2026-03-12 19:36:34 +00:00

13 lines
368 B
TypeScript

// Global toast handler for use outside React components (like in axios interceptor)
let globalShowGuestWarning: (() => void) | null = null;
export const setGlobalToastHandler = (handler: () => void) => {
globalShowGuestWarning = handler;
};
export const triggerGuestWarning = () => {
if (globalShowGuestWarning) {
globalShowGuestWarning();
}
};