mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Bug fix, maybe
This commit is contained in:
@@ -413,9 +413,6 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
throw new Error('401: Missing Credentials');
|
throw new Error('401: Missing Credentials');
|
||||||
}
|
}
|
||||||
if ((status === 403) && (data.error.message === '403 You can\'t see another user\'s favorites') ) {
|
|
||||||
throw new Error('403: User\'s avatar list isn\'t public');
|
|
||||||
}
|
|
||||||
if (data.error === Object(data.error)) {
|
if (data.error === Object(data.error)) {
|
||||||
this.$throw(
|
this.$throw(
|
||||||
data.error.status_code || status,
|
data.error.status_code || status,
|
||||||
@@ -5286,11 +5283,17 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.data.updateFriendInProgress = new Set();
|
||||||
|
|
||||||
$app.methods.updateFriend = async function (id, state, origin) {
|
$app.methods.updateFriend = async function (id, state, origin) {
|
||||||
var ctx = this.friends.get(id);
|
var ctx = this.friends.get(id);
|
||||||
if (typeof ctx === 'undefined') {
|
if (typeof ctx === 'undefined') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.updateFriendInProgress.has(id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.updateFriendInProgress.add(id);
|
||||||
var ref = API.cachedUsers.get(id);
|
var ref = API.cachedUsers.get(id);
|
||||||
var isVIP = API.cachedFavoritesByObjectId.has(id);
|
var isVIP = API.cachedFavoritesByObjectId.has(id);
|
||||||
if (typeof state === 'undefined' ||
|
if (typeof state === 'undefined' ||
|
||||||
@@ -5364,10 +5367,13 @@ speechSynthesis.getVoices();
|
|||||||
ref.location !== 'private') {
|
ref.location !== 'private') {
|
||||||
API.getUser({
|
API.getUser({
|
||||||
userId: id
|
userId: id
|
||||||
|
}).catch((err) => {
|
||||||
|
this.updateFriendInProgress.remove(id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ctx.state === 'online' && state === 'active') {
|
if (ctx.state === 'online' && state === 'active') {
|
||||||
|
this.updateFriendInProgress.delete(id);
|
||||||
await new Promise(resolve => setTimeout(resolve, 50000));
|
await new Promise(resolve => setTimeout(resolve, 50000));
|
||||||
if (this.APILastOnline.has(id)) {
|
if (this.APILastOnline.has(id)) {
|
||||||
var date = this.APILastOnline.get(id);
|
var date = this.APILastOnline.get(id);
|
||||||
@@ -5391,9 +5397,16 @@ speechSynthesis.getVoices();
|
|||||||
removeFromArray(this.friendsGroup3_, ctx);
|
removeFromArray(this.friendsGroup3_, ctx);
|
||||||
removeFromArray(this.friendsGroupD_, ctx);
|
removeFromArray(this.friendsGroupD_, ctx);
|
||||||
}
|
}
|
||||||
var { location, $location_at } = ref;
|
var location = '';
|
||||||
|
var $location_at = '';
|
||||||
|
if ((typeof ref !== 'undefined') &&
|
||||||
|
(typeof ref.location !== 'undefined')) {
|
||||||
|
var { location, $location_at } = ref;
|
||||||
|
}
|
||||||
var args = await API.getUser({
|
var args = await API.getUser({
|
||||||
userId: id
|
userId: id
|
||||||
|
}).catch((err) => {
|
||||||
|
this.updateFriendInProgress.remove(id);
|
||||||
});
|
});
|
||||||
if ((typeof args !== 'undefined') &&
|
if ((typeof args !== 'undefined') &&
|
||||||
(typeof args.ref !== 'undefined')) {
|
(typeof args.ref !== 'undefined')) {
|
||||||
@@ -5458,6 +5471,7 @@ speechSynthesis.getVoices();
|
|||||||
this.friendsGroupD_.unshift(ctx);
|
this.friendsGroupD_.unshift(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.updateFriendInProgress.delete(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ascending
|
// ascending
|
||||||
|
|||||||
Reference in New Issue
Block a user