Fix favourites search from crashing

Add session GUID for avatar search and updater requests
This commit is contained in:
Natsumi
2025-04-11 10:39:22 +10:00
parent 912e23f204
commit 30b1bf3332
4 changed files with 45 additions and 8 deletions

View File

@@ -295,6 +295,7 @@ console.log(`isLinux: ${LINUX}`);
console.error(err);
}
await AppApi.SetUserAgent();
await this.loadVrcxId();
this.appVersion = await AppApi.GetVersion();
await this.compareAppVersion();
await this.setBranch();
@@ -2669,6 +2670,14 @@ console.log(`isLinux: ${LINUX}`);
await configRepository.setString('VRCX_branch', this.branch);
};
$app.data.vrcxId = '';
$app.methods.loadVrcxId = async function () {
vrcxId = await configRepository.getString(
'VRCX_id',
crypto.randomUUID()
);
};
$app.methods.updateIsGameRunning = async function (
isGameRunning,
isSteamVRRunning,
@@ -9459,7 +9468,8 @@ console.log(`isLinux: ${LINUX}`);
}?${type}=${encodeURIComponent(search)}&n=5000`,
method: 'GET',
headers: {
Referer: 'https://vrcx.app'
Referer: 'https://vrcx.app',
'VRCX-ID': this.vrcxId
}
});
var json = JSON.parse(response.data);
@@ -9535,7 +9545,8 @@ console.log(`isLinux: ${LINUX}`);
url: `${url}?authorId=${encodeURIComponent(authorId)}`,
method: 'GET',
headers: {
Referer: 'https://vrcx.app'
Referer: 'https://vrcx.app',
'VRCX-ID': this.vrcxId
}
});
var json = JSON.parse(response.data);