mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Fixes
This commit is contained in:
@@ -599,6 +599,14 @@ speechSynthesis.getVoices();
|
|||||||
this.applyUserTrustLevel(ref);
|
this.applyUserTrustLevel(ref);
|
||||||
this.applyUserLanguage(ref);
|
this.applyUserLanguage(ref);
|
||||||
this.cachedUsers.set(ref.id, ref);
|
this.cachedUsers.set(ref.id, ref);
|
||||||
|
|
||||||
|
if (this.currentUser?.offlineFriends.includes(ref.id)) {
|
||||||
|
$app.addFriend(ref.id, 'offline');
|
||||||
|
} else if (this.currentUser?.activeFriends.includes(ref.id)) {
|
||||||
|
$app.addFriend(ref.id, 'active');
|
||||||
|
} else if (this.currentUser?.onlineFriends.includes(ref.id)) {
|
||||||
|
$app.addFriend(ref.id, 'online');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var props = {};
|
var props = {};
|
||||||
for (var prop in ref) {
|
for (var prop in ref) {
|
||||||
@@ -4219,7 +4227,7 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
API.$on('USER:CURRENT', function (args) {
|
API.$on('USER:CURRENT', function (args) {
|
||||||
// USER:CURRENT에서 처리를 함
|
// USER:CURRENT에서 처리를 함
|
||||||
$app.refreshFriends(args.ref, args.origin);
|
$app.refreshFriends(args.ref, args.fromGetCurrentUser);
|
||||||
$app.updateOnlineFriendCoutner();
|
$app.updateOnlineFriendCoutner();
|
||||||
|
|
||||||
if ($app.randomUserColours) {
|
if ($app.randomUserColours) {
|
||||||
@@ -4252,13 +4260,9 @@ speechSynthesis.getVoices();
|
|||||||
$app.updateFriend({ id: args.ref.favoriteId });
|
$app.updateFriend({ id: args.ref.favoriteId });
|
||||||
});
|
});
|
||||||
|
|
||||||
API.$on('LOGIN', function () {
|
|
||||||
$app.nextFriendsRefresh = 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
$app.methods.refreshFriendsList = async function () {
|
$app.methods.refreshFriendsList = async function () {
|
||||||
// If we just got user less then 1 min before code call, don't call it again
|
// If we just got user less then 2 min before code call, don't call it again
|
||||||
if (this.nextCurrentUserRefresh < 720) {
|
if (this.nextCurrentUserRefresh < 300) {
|
||||||
await API.getCurrentUser().catch((err) => {
|
await API.getCurrentUser().catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
@@ -4269,7 +4273,10 @@ speechSynthesis.getVoices();
|
|||||||
API.reconnectWebSocket();
|
API.reconnectWebSocket();
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.refreshFriends = function (ref, origin) {
|
$app.methods.refreshFriends = function (ref, fromGetCurrentUser) {
|
||||||
|
if (!this.friendLogInitStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var map = new Map();
|
var map = new Map();
|
||||||
for (var id of ref.friends) {
|
for (var id of ref.friends) {
|
||||||
map.set(id, 'offline');
|
map.set(id, 'offline');
|
||||||
@@ -4285,7 +4292,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
for (var [id, state] of map) {
|
for (var [id, state] of map) {
|
||||||
if (this.friends.has(id)) {
|
if (this.friends.has(id)) {
|
||||||
this.updateFriend({ id, state, origin });
|
this.updateFriend({ id, state, fromGetCurrentUser });
|
||||||
} else {
|
} else {
|
||||||
this.addFriend(id, state);
|
this.addFriend(id, state);
|
||||||
}
|
}
|
||||||
@@ -4408,7 +4415,7 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.updateFriendInProgress = new Map();
|
$app.data.updateFriendInProgress = new Map();
|
||||||
|
|
||||||
$app.methods.updateFriend = function (ctx) {
|
$app.methods.updateFriend = function (ctx) {
|
||||||
var { id, state, origin } = ctx;
|
var { id, state, fromGetCurrentUser } = ctx;
|
||||||
var stateInput = state;
|
var stateInput = state;
|
||||||
var ctx = this.friends.get(id);
|
var ctx = this.friends.get(id);
|
||||||
if (typeof ctx === 'undefined') {
|
if (typeof ctx === 'undefined') {
|
||||||
@@ -4475,11 +4482,16 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
// from getCurrentUser only, fetch user if offline in an instance
|
// from getCurrentUser only, fetch user if offline in an instance
|
||||||
if (
|
if (
|
||||||
origin &&
|
fromGetCurrentUser &&
|
||||||
ctx.state !== 'online' &&
|
ctx.state !== 'online' &&
|
||||||
typeof ref !== 'undefined' &&
|
typeof ref !== 'undefined' &&
|
||||||
this.isRealInstance(ref.location)
|
this.isRealInstance(ref.location)
|
||||||
) {
|
) {
|
||||||
|
if (this.debugFriendState) {
|
||||||
|
console.log(
|
||||||
|
`Fetching offline friend in an instance ${ctx.name}`
|
||||||
|
);
|
||||||
|
}
|
||||||
API.getUser({
|
API.getUser({
|
||||||
userId: id
|
userId: id
|
||||||
});
|
});
|
||||||
@@ -5343,10 +5355,11 @@ speechSynthesis.getVoices();
|
|||||||
} else {
|
} else {
|
||||||
await $app.initFriendLog(args.json.id);
|
await $app.initFriendLog(args.json.id);
|
||||||
}
|
}
|
||||||
|
$app.refreshFriends(args.ref, args.fromGetCurrentUser);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!$app.dontLogMeOut) {
|
if (!$app.dontLogMeOut) {
|
||||||
$app.$message({
|
$app.$message({
|
||||||
message: 'Failed to load freinds list, logging out',
|
message: 'Failed to load friends list, logging out',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
this.logout();
|
this.logout();
|
||||||
@@ -6855,7 +6868,9 @@ speechSynthesis.getVoices();
|
|||||||
API.getUser({
|
API.getUser({
|
||||||
userId: id
|
userId: id
|
||||||
});
|
});
|
||||||
} catch {}
|
} catch (err) {
|
||||||
|
console.error('Fetch user on add as friend', err);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
API.getFriendStatus({
|
API.getFriendStatus({
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default class extends baseClass {
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
origin: true
|
fromGetCurrentUser: true
|
||||||
};
|
};
|
||||||
if (
|
if (
|
||||||
json.requiresTwoFactorAuth &&
|
json.requiresTwoFactorAuth &&
|
||||||
|
|||||||
@@ -6,9 +6,17 @@ export default class extends baseClass {
|
|||||||
super(_app, _API, _t);
|
super(_app, _API, _t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
API.$on('LOGIN', function () {
|
||||||
|
$app.nextCurrentUserRefresh = 300;
|
||||||
|
$app.nextFriendsRefresh = 3600;
|
||||||
|
$app.nextGroupInstanceRefresh = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_data = {
|
_data = {
|
||||||
nextCurrentUserRefresh: 0,
|
nextCurrentUserRefresh: 300,
|
||||||
nextFriendsRefresh: 0,
|
nextFriendsRefresh: 3600,
|
||||||
nextGroupInstanceRefresh: 0,
|
nextGroupInstanceRefresh: 0,
|
||||||
nextAppUpdateCheck: 3600,
|
nextAppUpdateCheck: 3600,
|
||||||
ipcTimeout: 0,
|
ipcTimeout: 0,
|
||||||
|
|||||||
@@ -106,6 +106,12 @@ html
|
|||||||
include ./mixins/dialogs/groupDialog.pug
|
include ./mixins/dialogs/groupDialog.pug
|
||||||
+groupDialog()
|
+groupDialog()
|
||||||
|
|
||||||
|
include ./mixins/dialogs/favoritesDialog.pug
|
||||||
|
+favoritesDialog()
|
||||||
|
|
||||||
|
include ./mixins/dialogs/images.pug
|
||||||
|
+images()
|
||||||
|
|
||||||
include ./mixins/dialogs/newInstance.pug
|
include ./mixins/dialogs/newInstance.pug
|
||||||
+newInstance()
|
+newInstance()
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
mixin favorites()
|
mixin favoritesDialog()
|
||||||
//- dialog: favorite
|
//- dialog: favorite
|
||||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="favoriteDialog" :visible.sync="favoriteDialog.visible" :title="$t('dialog.favorite.header')" width="300px")
|
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="favoriteDialog" :visible.sync="favoriteDialog.visible" :title="$t('dialog.favorite.header')" width="300px")
|
||||||
div(v-if="favoriteDialog.visible" v-loading="favoriteDialog.loading")
|
div(v-if="favoriteDialog.visible" v-loading="favoriteDialog.loading")
|
||||||
Reference in New Issue
Block a user