currentUser previousDisplayNames on userDialog

This commit is contained in:
Natsumi
2025-10-29 01:03:54 +11:00
parent eabc3aa485
commit 9252e42238
2 changed files with 15 additions and 26 deletions
@@ -31,10 +31,13 @@
<template #content> <template #content>
<span>{{ t('dialog.user.previous_display_names') }}</span> <span>{{ t('dialog.user.previous_display_names') }}</span>
<div <div
v-for="displayName in userDialog.previousDisplayNames" v-for="data in userDialog.previousDisplayNames"
:key="displayName" :key="data.displayName"
placement="top"> placement="top">
<span v-text="displayName"></span> <span>{{ data.displayName }}</span>
<span v-if="data.updated_at">
&horbar; {{ formatDateFilter(data.updated_at, 'long') }}</span
>
</div> </div>
</template> </template>
<el-icon><CaretBottom /></el-icon> <el-icon><CaretBottom /></el-icon>
+9 -23
View File
@@ -273,17 +273,6 @@ export const useUserStore = defineStore('User', () => {
visible: false, visible: false,
userId: '' userId: ''
}); });
const pastDisplayNameTable = ref({
data: [],
tableProps: {
stripe: true,
size: 'small',
defaultSort: {
prop: 'updated_at',
order: 'descending'
}
}
});
const showUserDialogHistory = reactive(new Set()); const showUserDialogHistory = reactive(new Set());
const customUserTags = reactive(new Map()); const customUserTags = reactive(new Map());
@@ -309,7 +298,6 @@ export const useUserStore = defineStore('User', () => {
state.instancePlayerCount.clear(); state.instancePlayerCount.clear();
customUserTags.clear(); customUserTags.clear();
state.notes.clear(); state.notes.clear();
pastDisplayNameTable.value.data = [];
subsetOfLanguages.value = []; subsetOfLanguages.value = [];
} }
}, },
@@ -903,13 +891,13 @@ export const useUserStore = defineStore('User', () => {
} }
} }
); );
const displayNameMapSorted = new Map( displayNameMap.forEach(
[...displayNameMap.entries()].sort( (updated_at, displayName) => {
(a, b) => b[1] - a[1] D.previousDisplayNames.push({
) displayName,
); updated_at
D.previousDisplayNames = Array.from( });
displayNameMapSorted.keys() }
); );
}); });
AppApi.GetVRChatUserModeration( AppApi.GetVRChatUserModeration(
@@ -924,6 +912,8 @@ export const useUserStore = defineStore('User', () => {
} }
}); });
} else { } else {
D.previousDisplayNames =
currentUser.value.pastDisplayNames;
database database
.getUserStats(D.ref, inCurrentWorld) .getUserStats(D.ref, inCurrentWorld)
.then((ref1) => { .then((ref1) => {
@@ -1867,9 +1857,6 @@ export const useUserStore = defineStore('User', () => {
); );
} }
} }
if (ref.pastDisplayNames) {
pastDisplayNameTable.value.data = ref.pastDisplayNames;
}
// when isGameRunning use gameLog instead of API // when isGameRunning use gameLog instead of API
const $location = parseLocation(locationStore.lastLocation.location); const $location = parseLocation(locationStore.lastLocation.location);
@@ -1976,7 +1963,6 @@ export const useUserStore = defineStore('User', () => {
subsetOfLanguages, subsetOfLanguages,
languageDialog, languageDialog,
sendBoopDialog, sendBoopDialog,
pastDisplayNameTable,
showUserDialogHistory, showUserDialogHistory,
customUserTags, customUserTags,
cachedUsers, cachedUsers,