VRC Credits on user dialog

This commit is contained in:
Natsumi
2025-11-02 02:38:18 +11:00
parent 40ef317491
commit d1a891eb12

View File

@@ -452,6 +452,15 @@
</div>
</div>
</template>
<div
v-if="userDialog.ref.id === currentUser.id"
class="x-friend-item"
@click="getVRChatCredits()">
<div class="detail">
<span class="name">{{ t('view.profile.profile.vrchat_credits') }}</span>
<span class="extra">{{ vrchatCredit ?? t('view.profile.profile.refresh') }}</span>
</div>
</div>
<div
v-if="userDialog.ref.id === currentUser.id && currentUser.homeLocation"
class="x-friend-item"
@@ -1431,6 +1440,7 @@
});
const isEditNoteAndMemoDialogVisible = ref(false);
const vrchatCredit = ref(null);
const userDialogAvatars = computed(() => {
const { avatars, avatarReleaseStatus } = userDialog.value;
@@ -1485,7 +1495,11 @@
function handleUserDialogTab(tabName) {
const userId = userDialog.value.id;
if (tabName === 'Groups') {
if (tabName === 'Info') {
if (vrchatCredit.value === null) {
getVRChatCredits();
}
} else if (tabName === 'Groups') {
if (userDialogLastGroup.value !== userId) {
userDialogLastGroup.value = userId;
getUserGroups(userId);
@@ -2467,4 +2481,8 @@
function closeInviteDialog() {
clearInviteImageUpload();
}
function getVRChatCredits() {
miscRequest.getVRChatCredits().then((args) => (vrchatCredit.value = args.json?.balance));
}
</script>