stable launch 100% (yeeees)

This commit is contained in:
2025-12-04 01:10:47 +05:00
parent 5deba6ca92
commit fcbc2352dc
3 changed files with 73 additions and 22 deletions

View File

@ -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
};