maybe work
This commit is contained in:
@ -115,17 +115,21 @@ const LaunchPage = ({
|
||||
const savedConfig = localStorage.getItem('selected_version_config');
|
||||
if (savedConfig) {
|
||||
const parsedConfig = JSON.parse(savedConfig);
|
||||
setVersionConfig(parsedConfig);
|
||||
|
||||
// Устанавливаем значения памяти и preserveFiles из конфигурации
|
||||
setConfig({
|
||||
memory: parsedConfig.memory || 4096,
|
||||
preserveFiles: parsedConfig.preserveFiles || [],
|
||||
});
|
||||
// Если конфиг пустой — считаем, что он невалидный и идём по IPC-ветке
|
||||
if (Object.keys(parsedConfig).length > 0) {
|
||||
setVersionConfig(parsedConfig);
|
||||
|
||||
// Очищаем localStorage
|
||||
localStorage.removeItem('selected_version_config');
|
||||
return;
|
||||
setConfig({
|
||||
memory: parsedConfig.memory || 4096,
|
||||
preserveFiles: parsedConfig.preserveFiles || [],
|
||||
});
|
||||
|
||||
localStorage.removeItem('selected_version_config');
|
||||
return;
|
||||
} else {
|
||||
localStorage.removeItem('selected_version_config');
|
||||
}
|
||||
}
|
||||
|
||||
// Если нет в localStorage, запрашиваем с сервера
|
||||
|
||||
Reference in New Issue
Block a user