13 lines
368 B
TypeScript
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();
|
|
}
|
|
};
|