Small changes

This commit is contained in:
Natsumi
2023-01-01 22:15:38 +13:00
parent 0fc9dc8dcb
commit 93eea773cc
4 changed files with 92 additions and 42 deletions

View File

@@ -2805,45 +2805,49 @@ speechSynthesis.getVoices();
API.refreshNotifications = async function () {
this.isNotificationsLoading = true;
this.expireFriendRequestNotifications();
var params = {
n: 100,
offset: 0
};
var count = 50; // 5000 max
for (var i = 0; i < count; i++) {
var args = await this.getNotifications(params);
$app.unseenNotifications = [];
params.offset += 100;
if (args.json.length < 100) {
break;
try {
this.expireFriendRequestNotifications();
var params = {
n: 100,
offset: 0
};
var count = 50; // 5000 max
for (var i = 0; i < count; i++) {
var args = await this.getNotifications(params);
$app.unseenNotifications = [];
params.offset += 100;
if (args.json.length < 100) {
break;
}
}
}
var params = {
n: 100,
offset: 0
};
var count = 50; // 5000 max
for (var i = 0; i < count; i++) {
var args = await this.getNotificationsV2(params);
$app.unseenNotifications = [];
params.offset += 100;
if (args.json.length < 100) {
break;
var params = {
n: 100,
offset: 0
};
var count = 50; // 5000 max
for (var i = 0; i < count; i++) {
var args = await this.getNotificationsV2(params);
$app.unseenNotifications = [];
params.offset += 100;
if (args.json.length < 100) {
break;
}
}
}
var params = {
n: 100,
offset: 0
};
var count = 50; // 5000 max
for (var i = 0; i < count; i++) {
var args = await this.getHiddenFriendRequests(params);
$app.unseenNotifications = [];
params.offset += 100;
if (args.json.length < 100) {
break;
var params = {
n: 100,
offset: 0
};
var count = 50; // 5000 max
for (var i = 0; i < count; i++) {
var args = await this.getHiddenFriendRequests(params);
$app.unseenNotifications = [];
params.offset += 100;
if (args.json.length < 100) {
break;
}
}
} catch (err) {
console.error(err);
}
this.isNotificationsLoading = false;
};
@@ -2933,6 +2937,28 @@ speechSynthesis.getVoices();
});
});
API.$on('NOTIFICATION:V2:UPDATE', function (args) {
var notificationId = args.params.notificationId;
var json = args.json;
if (!json) {
return;
}
json.id = notificationId;
this.$emit('NOTIFICATION', {
json,
params: {
notificationId
}
});
if (json.seen) {
this.$emit('NOTIFICATION:SEE', {
params: {
notificationId
}
});
}
});
/*
params: {
notificationId: string,
@@ -4183,6 +4209,16 @@ speechSynthesis.getVoices();
}
break;
case 'notification-v2-update':
console.log('notification-v2-update', content);
this.$emit('NOTIFICATION:V2:UPDATE', {
json: content.updates,
params: {
notificationId: content.id
}
});
break;
case 'see-notification':
this.$emit('NOTIFICATION:SEE', {
params: {
@@ -11161,6 +11197,9 @@ speechSynthesis.getVoices();
var partyId = `${L.worldId}:${L.instanceName}`;
var partySize = this.lastLocation.playerList.size;
var partyMaxSize = L.worldCapacity;
if (partySize > partyMaxSize) {
partyMaxSize = partySize;
}
var buttonText = 'Join';
var buttonUrl = L.joinUrl;
if (!this.discordJoinButton) {