Fix config reset when selecting app

This commit is contained in:
Patrick Nicolas committed 2026-02-18 11:20:13 +01:00
1 parent 028e4a3384
commit 206ec71150
1 file changed
+3 -20
+3 -20
View File
@@ -7,8 +7,6 @@ import io.github.wivrn.wivrn
ColumnLayout {
id: select_game
property bool json_loaded: false
Component.onCompleted: {
apps.append({
"name": i18nc("don't start an application automatically", "None"),
@@ -75,13 +73,8 @@ ColumnLayout {
}
}
function reload() {
select_game.json_loaded = false;
load();
}
function load() {
if (select_game.json_loaded || WivrnServer.serverStatus != WivrnServer.Started || WivrnServer.jsonConfiguration == "")
if (WivrnServer.jsonConfiguration == "")
return;
Settings.load(WivrnServer);
@@ -103,22 +96,12 @@ ColumnLayout {
app_text.text = Settings.application;
app_combobox.currentIndex = custom_idx;
}
select_game.json_loaded = true;
}
function save() {
var new_application;
if (apps.get(app_combobox.currentIndex).is_custom)
new_application = app_text.text;
Settings.application = app_text.text;
else
new_application = apps.get(app_combobox.currentIndex).command;
Settings.load(WivrnServer);
if (Settings.application != new_application) {
Settings.application = new_application;
Settings.save(WivrnServer);
}
Settings.application = apps.get(app_combobox.currentIndex).command;
}
}