merge main

This commit is contained in:
end-4
2026-04-05 23:20:10 +02:00
5 changed files with 107 additions and 54 deletions
@@ -8,7 +8,7 @@ Singleton {
id: root
property var keyContent: ({})
property string keyProjectId: keyContent.project_id
property string keyProjectId: keyContent?.project_id
property bool keyError: false
property bool keyReady: false
property string token: ""
@@ -32,9 +32,17 @@ Singleton {
}
}
function unready() {
root.keyReady = false;
root.tokenReady = false;
root.keyError = false;
root.tokenError = false;
}
function setKeyJson(str: string): bool {
try {
var keyData = JSON.parse(str)
root.unready();
KeyringStorage.setNestedField(["googleCloud", "serviceAccountKey"], keyData);
return true;
} catch(e) {
@@ -65,6 +73,7 @@ Singleton {
} catch(e) {
root.tokenError = true;
print("[GoogleCloud] Failed to parse token response: " + e)
print("[GoogleCloud] Failed to parse token response: " + e + "\n" + out)
}
root.tokenReady = true;
}