Wrist online friend counter

This commit is contained in:
Natsumi
2022-01-01 00:15:14 +13:00
parent 92f8500d31
commit 88c696c3e2
3 changed files with 28 additions and 1 deletions

View File

@@ -6670,6 +6670,9 @@ speechSynthesis.getVoices();
this.friendsGroup3_.push(ctx);
this.friendsGroupD_.unshift(ctx);
}
if (ctx.state !== newState) {
this.updateOnlineFriendCoutner();
}
ctx.state = newState;
ctx.name = ctx.ref.displayName;
ctx.isVIP = isVIP;
@@ -6711,6 +6714,19 @@ speechSynthesis.getVoices();
}
};
$app.data.onlineFriendCount = 0;
$app.methods.updateOnlineFriendCoutner = function () {
var onlineFriendCount =
this.friendsGroup0.length + this.friendsGroup1.length;
if (onlineFriendCount !== this.onlineFriendCount) {
AppApi.ExecuteVrFeedFunction(
'updateOnlineFriendCount',
`${onlineFriendCount}`
);
this.onlineFriendCount = onlineFriendCount;
}
};
// ascending
var compareByName = function (a, b) {
var A = String(a.name).toUpperCase();
@@ -11413,6 +11429,10 @@ speechSynthesis.getVoices();
this.updateVRLastLocation();
this.updateVrNowPlaying();
this.updateSharedFeed(true);
AppApi.ExecuteVrFeedFunction(
'updateOnlineFriendCount',
`${this.onlineFriendCount}`
);
};
API.$on('LOGIN', function () {