Check for friend/unfriend faster at startup

This commit is contained in:
Natsumi
2022-05-26 06:10:35 +12:00
parent abd3e82898
commit dd66645bb6
+5 -1
View File
@@ -10790,12 +10790,16 @@ speechSynthesis.getVoices();
this.friendLogTable.data = await database.getFriendLogHistory(); this.friendLogTable.data = await database.getFriendLogHistory();
await API.refreshFriends(); await API.refreshFriends();
this.friendLogInitStatus = true; this.friendLogInitStatus = true;
// check for friend/name/rank change AFTER friendLogInitStatus is set
for (var friend of friendLogCurrentArray) { for (var friend of friendLogCurrentArray) {
var ref = API.cachedUsers.get(friend.userId); var ref = API.cachedUsers.get(friend.userId);
if (typeof ref !== 'undefined') { if (typeof ref !== 'undefined') {
this.updateFriendship(ref); this.updateFriendship(ref);
} }
} }
if (typeof API.currentUser.friends !== 'undefined') {
this.updateFriendships(API.currentUser);
}
}; };
$app.methods.addFriendship = function (id) { $app.methods.addFriendship = function (id) {
@@ -12524,7 +12528,7 @@ speechSynthesis.getVoices();
$app.methods.promptChangeWorldYouTubePreview = function (world) { $app.methods.promptChangeWorldYouTubePreview = function (world) {
this.$prompt( this.$prompt(
'Enter world YouTube preview, WARNING: once a preview is added it cannot be removed', 'Enter world YouTube preview',
'Change YouTube Preview', 'Change YouTube Preview',
{ {
distinguishCancelAndClose: true, distinguishCancelAndClose: true,