stable launch 100% (yeeees)
This commit is contained in:
@ -91,6 +91,22 @@ const LaunchPage = ({
|
||||
setInstallMessage(status.message);
|
||||
};
|
||||
|
||||
const minecraftErrorListener = (...args: unknown[]) => {
|
||||
const payload = (args[0] || {}) as {
|
||||
message?: string;
|
||||
stderr?: string;
|
||||
code?: number;
|
||||
};
|
||||
|
||||
// Главное — показать пользователю, что запуск не удался
|
||||
showNotification(
|
||||
payload.message ||
|
||||
'Minecraft завершился с ошибкой. Подробности смотрите в логах.',
|
||||
'error',
|
||||
);
|
||||
};
|
||||
|
||||
window.electron.ipcRenderer.on('minecraft-error', minecraftErrorListener);
|
||||
window.electron.ipcRenderer.on('download-progress', progressListener);
|
||||
window.electron.ipcRenderer.on('installation-status', statusListener);
|
||||
|
||||
@ -101,6 +117,7 @@ const LaunchPage = ({
|
||||
if (typeof cleanup === 'function') {
|
||||
cleanup('download-progress', progressListener);
|
||||
cleanup('installation-status', statusListener);
|
||||
cleanup('minecraft-error', statusListener);
|
||||
}
|
||||
// Удаляем использование removeAllListeners
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user