mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-29 19:53:47 +02:00
feat: Limit bio display height(#1158), Toggle for display of age gated instances(#1188), fix: (#1189)(#1192) (#1195)
This commit is contained in:
@@ -4,6 +4,7 @@ import configRepository from '../repository/config.js';
|
||||
import database from '../repository/database.js';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
import { userRequest } from './request';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
@@ -168,7 +169,8 @@ export default class extends baseClass {
|
||||
if (typeof friendRef?.ref !== 'undefined') {
|
||||
friendRef.ref.$joinCount++;
|
||||
friendRef.ref.$lastSeen = new Date().toJSON();
|
||||
friendRef.ref.$timeSpent += Date.now() - ref.joinTime;
|
||||
friendRef.ref.$timeSpent +=
|
||||
dayjs(gameLog.dt) - ref.joinTime;
|
||||
if (
|
||||
this.sidebarSortMethods.includes(
|
||||
'Sort by Last Seen'
|
||||
@@ -178,7 +180,7 @@ export default class extends baseClass {
|
||||
this.sortOnlineFriends = true;
|
||||
}
|
||||
}
|
||||
var time = Date.now() - ref.joinTime;
|
||||
var time = dayjs(gameLog.dt) - ref.joinTime;
|
||||
this.lastLocation.playerList.delete(userId);
|
||||
this.lastLocation.friendList.delete(userId);
|
||||
this.photonLobbyAvatars.delete(userId);
|
||||
|
||||
@@ -402,5 +402,24 @@ export default {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
convertFileUrlToImageUrl(url, resolution = 128) {
|
||||
/**
|
||||
* possible patterns?
|
||||
* /file/file_fileId/version
|
||||
* /file/file_fileId/version/
|
||||
* /file/file_fileId/version/file
|
||||
* /file/file_fileId/version/file/
|
||||
*/
|
||||
const pattern = /file\/file_([a-f0-9-]+)\/(\d+)(\/file)?\/?$/;
|
||||
const match = url.match(pattern);
|
||||
|
||||
if (match) {
|
||||
const fileId = match[1];
|
||||
const version = match[2];
|
||||
return `https://api.vrchat.cloud/api/1/image/file_${fileId}/${version}/${resolution}`;
|
||||
}
|
||||
// no match return origin url
|
||||
return url;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user