add: second attemp to first run minecraft
This commit is contained in:
@ -95,11 +95,14 @@ const LaunchPage = () => {
|
||||
);
|
||||
|
||||
if (downloadResult?.success) {
|
||||
let needsSecondAttempt = false;
|
||||
|
||||
if (downloadResult.updated) {
|
||||
showNotification(
|
||||
`Сборка успешно обновлена до версии ${downloadResult.version}`,
|
||||
'success',
|
||||
);
|
||||
needsSecondAttempt = true;
|
||||
} else {
|
||||
showNotification(
|
||||
`Установлена актуальная версия сборки ${downloadResult.version}`,
|
||||
@ -117,7 +120,26 @@ const LaunchPage = () => {
|
||||
},
|
||||
);
|
||||
|
||||
if (launchResult?.success) {
|
||||
if (needsSecondAttempt) {
|
||||
showNotification(
|
||||
'Завершаем настройку компонентов, повторный запуск...',
|
||||
'info',
|
||||
);
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
|
||||
const secondAttempt = await window.electron.ipcRenderer.invoke(
|
||||
'launch-minecraft',
|
||||
{
|
||||
accessToken: savedConfig.accessToken,
|
||||
uuid: savedConfig.uuid,
|
||||
username: savedConfig.username,
|
||||
memory: savedConfig.memory || 4096,
|
||||
},
|
||||
);
|
||||
|
||||
showNotification('Minecraft успешно запущен!', 'success');
|
||||
} else if (launchResult?.success) {
|
||||
showNotification('Minecraft успешно запущен!', 'success');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user