mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 20:40:21 +02:00
25 lines
652 B
TypeScript
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',
|
|
}),
|
|
});
|
|
};
|