Files
feishin/src/renderer/features/settings/restart-toast.ts
T
2025-12-15 11:27:17 -08:00

25 lines
652 B
TypeScript

import { t } from 'i18next';
import isElectron from 'is-electron';
import { toast } from '/@/shared/components/toast/toast';
const ipc = isElectron() ? window.api.ipc : null;
export const openRestartRequiredToast = (message?: string) => {
return toast.warn({
autoClose: false,
id: 'restart-toast',
message:
message ||
t('common.forceRestartRequired', {
postProcess: 'sentenceCase',
}),
onClose: () => {
ipc?.send('app-restart');
},
title: t('common.restartRequired', {
postProcess: 'sentenceCase',
}),
});
};