Fixed a client bug

This commit is contained in:
WolverinDEV 2021-04-25 15:41:41 +02:00
parent edff7d4014
commit c94b94c508
6 changed files with 18 additions and 6 deletions

2
github

@ -1 +1 @@
Subproject commit 90d3a6c84c003ab42a3ecfb5197b9368897862b1
Subproject commit a46f54984b7ad9721c01273e77807469cd2c63a9

View File

@ -124,4 +124,4 @@ function deploy_client() {
#compile_scripts
#compile_native
package_client
#deploy_client
deploy_client

View File

@ -21,6 +21,11 @@ export class ClientStorageAdapter implements StorageAdapter {
const result = await fs.readFile(storageKeyPath(key));
return JSON.parse(result.toString());
} catch (error) {
if(error.code === "ENOENT") {
/* The file does not exists */
return null;
}
logError(LogCategory.GENERAL, tr("Failed to load client storage key %s: %o"), key, error);
return null;
}

View File

@ -136,7 +136,14 @@ export class ClientUpdater implements Updater {
}
getLastUsedVersion(): string {
return settings.getValue(Settings.KEY_UPDATER_LAST_USED_CLIENT, undefined);
const result = settings.getValue(Settings.KEY_UPDATER_LAST_USED_CLIENT, undefined);
if(result === undefined) {
/* We never have executed the client */
this.updateUsedVersion();
return this.getCurrentVersion();
}
return result;
}
updateUsedVersion() {

View File

@ -15,7 +15,7 @@ using namespace std;
return GetBinaryTypeA(file.c_str(), lpBinaryType);
}
VOID execute_app(LPCTSTR lpApplicationName,LPSTR arguments)
void execute_app(LPCTSTR lpApplicationName,LPSTR arguments)
{
// additional information
STARTUPINFO si;
@ -32,7 +32,7 @@ using namespace std;
nullptr, // Process handle not inheritable
nullptr, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
CREATE_NEW_CONSOLE , // No creation flags
CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE , // No creation flags
nullptr, // Use parent's environment block
nullptr, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure

View File

@ -6,7 +6,7 @@
"scripts": {
"crash_handler": "electron . crash-handler",
"test": "echo \"Error: no test specified\" && exit 1",
"start-download-dev": "electron . --disable-hardware-acceleration --gdb --debug --updater-ui-loader_type=0 -t -u https://clientapi.teaspeak.dev/",
"start-download-dev": "electron . --disable-hardware-acceleration --gdb --debug -t -u https://clientapi.teaspeak.dev/",
"start-s": "electron . --disable-hardware-acceleration --gdb --debug --updater-ui-loader_type=3 --updater-ui-ignore-version -t -u http://localhost:8080/",
"dtest": "electron . dtest",
"sass": "sass",