Add Avatar Wear Timers (#1086)

* Update avatar history table

* Tracking time when swapping avis

* Time spent now visible on application

* Added wear time tracking on game open/close

* Update avatar history table

* Tracking time when swapping avis

* Time spent now visible on application

* Added wear time tracking on game open/close

* Adjusted "ON CONFLICT" query

* Removed unneccesary "previousAvatar" parameter
This commit is contained in:
Tamara
2025-01-21 17:43:51 +01:00
committed by GitHub
parent 555d4adf60
commit f27d213a0d
16 changed files with 106 additions and 20 deletions

View File

@@ -106,7 +106,6 @@ export default class extends baseClass {
travelingToInstance = json.presence.travelingToInstance;
travelingToWorld = json.presence.travelingToWorld;
}
this.applyUser({
allowAvatarCopying: json.allowAvatarCopying,
badges: json.badges,
@@ -166,6 +165,8 @@ export default class extends baseClass {
if (this.isLoggedIn) {
if (json.currentAvatar !== ref.currentAvatar) {
$app.addAvatarToHistory(json.currentAvatar);
$app.addAvatarWearTime(ref.currentAvatar);
this.currentUser.$previousAvatarSwapTime = Date.now();
}
Object.assign(ref, json);
if (ref.homeLocation !== ref.$homeLocation.tag) {
@@ -277,6 +278,7 @@ export default class extends baseClass {
$offline_for: '',
$location_at: Date.now(),
$travelingToTime: Date.now(),
$previousAvatarSwapTime: Date.now(),
$homeLocation: {},
$isVRCPlus: false,
$isModerator: false,