diff --git a/html/src/app.js b/html/src/app.js index c935f190..baf3612a 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -3712,7 +3712,7 @@ speechSynthesis.getVoices(); try { if (API.isLoggedIn === true) { if (--this.nextCurrentUserRefresh <= 0) { - this.nextCurrentUserRefresh = 120; // 1min + this.nextCurrentUserRefresh = 60; // 30secs API.getCurrentUser().catch((err1) => { throw err1; }); @@ -4415,7 +4415,7 @@ speechSynthesis.getVoices(); }; $app.methods.displayXSNotification = async function (noty, message, image) { - var timeout = parseInt(this.notificationTimeout) / 1000; + var timeout = parseInt(parseInt(this.notificationTimeout) / 1000); switch (noty.type) { case 'OnPlayerJoined': AppApi.XSNotification('VRCX', `${noty.data} has joined`, timeout, image); @@ -7743,9 +7743,13 @@ speechSynthesis.getVoices(); API.getUser(args.params); } this.getAvatarName(args); - if (D.ref.$location.worldId) { + var L = API.parseLocation(D.ref.location); + if ((L.worldId) && + (this.lastLocation.location !== L.tag) && + ((L.accessType === 'public') || + (this.friends.has(L.userId)))) { API.getWorld({ - worldId: D.ref.$location.worldId + worldId: L.worldId }); } } @@ -7919,12 +7923,15 @@ speechSynthesis.getVoices(); }); }; - $app.methods.refreshUserDialogAvatars = function () { + $app.methods.refreshUserDialogAvatars = function (fileId) { var D = this.userDialog; if (D.isAvatarsLoading) { return; } D.isAvatarsLoading = true; + if (fileId) { + D.loading = true; + } var params = { n: 50, offset: 0, @@ -7955,6 +7962,19 @@ speechSynthesis.getVoices(); var array = Array.from(map.values()); this.setUserDialogAvatars(array); D.isAvatarsLoading = false; + if (fileId) { + D.loading = false; + for (var ref of array) { + if (extractFileId(ref.imageUrl) === fileId) { + this.showAvatarDialog(ref.id); + return; + } + } + this.$message({ + message: 'Own avatar not found', + type: 'error' + }); + } } }); }; @@ -8099,43 +8119,7 @@ speechSynthesis.getVoices(); }); } else if (command === 'Show Avatar Author') { var { currentAvatarImageUrl } = D.ref; - for (var ref of API.cachedAvatars.values()) { - if (ref.imageUrl === currentAvatarImageUrl) { - this.showAvatarDialog(ref.id); - return; - } - } - var fileId = extractFileId(currentAvatarImageUrl); - if (fileId) { - if (API.cachedAvatarNames.has(fileId)) { - var { ownerId } = API.cachedAvatarNames.get(fileId); - if (ownerId === D.id) { - this.$message({ - message: 'It\'s personal (own) avatar', - type: 'warning' - }); - return; - } - this.showUserDialog(ownerId); - } else { - API.getAvatarImages({fileId}).then((args) => { - var ownerId = args.json.ownerId; - if (ownerId === D.id) { - this.$message({ - message: 'It\'s personal (own) avatar', - type: 'warning' - }); - return; - } - this.showUserDialog(ownerId); - }); - } - } else { - this.$message({ - message: 'Sorry, the author is unknown', - type: 'error' - }); - } + this.showAvatarAuthorDialog(D.id, currentAvatarImageUrl) } else if (command === 'Show Fallback Avatar Details') { var { fallbackAvatar } = D.ref; if (fallbackAvatar) { @@ -8710,19 +8694,33 @@ speechSynthesis.getVoices(); }; $app.methods.showAvatarAuthorDialog = function (refUserId, currentAvatarImageUrl) { + var fileId = extractFileId(currentAvatarImageUrl); + if (!fileId) { + this.$message({ + message: 'Sorry, the author is unknown', + type: 'error' + }); + return; + } + if (refUserId === API.currentUser.id) { + this.showAvatarDialog(API.currentUser.currentAvatar); + return; + } for (var ref of API.cachedAvatars.values()) { - if (ref.imageUrl === currentAvatarImageUrl) { + if (extractFileId(ref.imageUrl) === fileId) { this.showAvatarDialog(ref.id); return; } } - var fileId = extractFileId(currentAvatarImageUrl); - if (fileId) { - if (API.cachedAvatarNames.has(fileId)) { - var { ownerId } = API.cachedAvatarNames.get(fileId); - if (ownerId === refUserId) { - this.$message({ - message: 'It\'s personal (own) avatar', + if (API.cachedAvatarNames.has(fileId)) { + var { ownerId } = API.cachedAvatarNames.get(fileId); + if (ownerId === API.currentUser.id) { + this.refreshUserDialogAvatars(fileId); + return; + } + if (ownerId === refUserId) { + this.$message({ + message: 'It\'s personal (own) avatar', type: 'warning' }); return; @@ -8738,13 +8736,7 @@ speechSynthesis.getVoices(); }); return; } - this.showUserDialog(ownerId); - }); - } - } else { - this.$message({ - message: 'Sorry, the author is unknown', - type: 'error' + this.showUserDialog(ownerId); }); } }; diff --git a/html/src/index.pug b/html/src/index.pug index aa12f32f..24d8974d 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1083,6 +1083,7 @@ html el-tab-pane(label="Avatars") template(v-if="userDialog.ref.id === API.currentUser.id") el-button(type="default" :loading="userDialog.isAvatarsLoading" @click="refreshUserDialogAvatars()" size="mini" icon="el-icon-refresh" circle) + template(v-if="userDialogAvatars.length > 0") span(style="margin-left:5px") Total {{ userDialogAvatars.length }} el-radio-group(v-model="userDialog.avatarSorting" size="mini" style="margin-left:30px" @change="changeUserDialogAvatarSorting") el-radio(label="name") by name diff --git a/html/src/vr.pug b/html/src/vr.pug index d194e82f..648e2506 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -262,9 +262,14 @@ html span {{ device[2] }}% .x-containerbottom template(v-if="lastLocation.date != 0") - span(style="float:right") Timer: {{ lastLocationTimer }} - span(style="display:inline-block") Players: {{ lastLocation.playerList.length }} - span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? `‎‎‎‎‎‎‎‎‏‏‎ ‎(${lastLocation.friendList.length})` : ''}} + template(v-if="config && config.minimalFeed") + span(style="float:right") {{ lastLocationTimer }} + span(style="display:inline-block") {{ lastLocation.playerList.length }} + span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? `‎‎‎‎‎‎‎‎‏‏‎ ‎(${lastLocation.friendList.length})` : ''}} + template(v-else) + span(style="float:right") Timer: {{ lastLocationTimer }} + span(style="display:inline-block") Players: {{ lastLocation.playerList.length }} + span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? `‎‎‎‎‎‎‎‎‏‏‎ ‎(${lastLocation.friendList.length})` : ''}} br span(style="float:right") {{ currentTime | formatDate('YYYY-MM-DD HH:MI:SS AMPM') }} span CPU {{ cpuUsage }}%