Fix updated at dates

This commit is contained in:
Natsumi
2026-02-06 08:31:45 +13:00
committed by pa
parent d3e44523bd
commit 752c75b37c
3 changed files with 58 additions and 7 deletions

View File

@@ -455,10 +455,12 @@
side="top"
style="margin-left: 5px">
<template #content>
<template v-for="(data, platform) in avatarDialog.fileAnalysis" :key="platform">
<template
v-for="(created_at, platform) in avatarDialogPlatformCreatedAt"
:key="platform">
<div class="flex justify-between w-full">
<span class="mr-1">{{ platform }}:</span>
<span>{{ formatDateFilter(data.created_at, 'long') }}</span>
<span>{{ formatDateFilter(created_at, 'long') }}</span>
</div>
</template>
</template>
@@ -570,6 +572,7 @@
import {
commaNumber,
compareUnityVersion,
copyToClipboard,
downloadAndSaveJson,
formatDateFilter,
@@ -667,6 +670,10 @@
unityPackage.variant !== 'standard' &&
unityPackage.variant !== 'security'
) {
// skip imposters
continue;
}
if (!compareUnityVersion(unityPackage.unitySortNumber)) {
continue;
}
let platform = 'PC';
@@ -675,7 +682,7 @@
} else if (unityPackage.platform === 'android') {
platform = 'Android';
} else if (unityPackage.platform) {
({ platform } = unityPackage);
platform = unityPackage.platform;
}
platforms.push(`${platform}/${unityPackage.unityVersion}`);
}
@@ -683,6 +690,25 @@
return platforms.join(', ');
});
const avatarDialogPlatformCreatedAt = computed(() => {
const { ref } = avatarDialog.value;
if (!ref.unityPackages) {
return null;
}
let newest = {};
for (const unityPackage of ref.unityPackages) {
if (unityPackage.variant && unityPackage.variant !== 'standard' && unityPackage.variant !== 'security') {
continue;
}
const platform = unityPackage.platform;
const createdAt = unityPackage.created_at;
if (!newest[platform] || new Date(createdAt) > new Date(newest[platform])) {
newest[platform] = createdAt;
}
}
return newest;
});
watch(
() => avatarDialog.value.loading,
() => {

View File

@@ -574,10 +574,12 @@
side="top"
style="margin-left: 5px">
<template #content>
<template v-for="(data, platform) in worldDialog.fileAnalysis" :key="platform">
<template
v-for="(created_at, platform) in worldDialogPlatformCreatedAt"
:key="platform">
<div class="flex justify-between w-full">
<span class="mr-1">{{ platform }}:</span>
<span>{{ formatDateFilter(data.created_at, 'long') }}</span>
<span>{{ formatDateFilter(created_at, 'long') }}</span>
</div>
</template>
</template>
@@ -790,6 +792,7 @@
import {
commaNumber,
compareUnityVersion,
deleteVRChatCache,
downloadAndSaveJson,
formatDateFilter,
@@ -933,13 +936,16 @@
const platforms = [];
if (ref.unityPackages) {
for (const unityPackage of ref.unityPackages) {
if (!compareUnityVersion(unityPackage.unitySortNumber)) {
continue;
}
let platform = 'PC';
if (unityPackage.platform === 'standalonewindows') {
platform = 'PC';
} else if (unityPackage.platform === 'android') {
platform = 'Android';
} else if (unityPackage.platform) {
({ platform } = unityPackage);
platform = unityPackage.platform;
}
platforms.unshift(`${platform}/${unityPackage.unityVersion}`);
}
@@ -947,6 +953,25 @@
return platforms.join(', ');
});
const worldDialogPlatformCreatedAt = computed(() => {
const { ref } = worldDialog.value;
if (!ref.unityPackages) {
return null;
}
let newest = {};
for (const unityPackage of ref.unityPackages) {
if (unityPackage.variant && unityPackage.variant !== 'standard' && unityPackage.variant !== 'security') {
continue;
}
const platform = unityPackage.platform;
const createdAt = unityPackage.created_at;
if (!newest[platform] || new Date(createdAt) > new Date(newest[platform])) {
newest[platform] = createdAt;
}
}
return newest;
});
watch(
() => worldDialog.value.loading,
() => {

View File

@@ -571,8 +571,8 @@ export const useAvatarStore = defineStore('Avatar', () => {
if (!providerUrl || !authorId) {
return avatars;
}
const url = `${providerUrl}?authorId=${encodeURIComponent(authorId)}`;
try {
const url = `${providerUrl}?authorId=${encodeURIComponent(authorId)}`;
const response = await webApiService.execute({
url,
method: 'GET',