mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 17:23:50 +02:00
refactor queryRequest
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
import { queryRequest } from '../api';
|
||||
import { useUserStore } from '../stores';
|
||||
import { userRequest } from '../api';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -22,18 +22,24 @@
|
||||
|
||||
const username = ref(props.userid);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async function parse() {
|
||||
username.value = props.userid;
|
||||
if (props.hint) {
|
||||
username.value = props.hint;
|
||||
} else if (props.userid) {
|
||||
const args = await userRequest.getCachedUser({ userId: props.userid });
|
||||
const args = await queryRequest.fetch('user', { userId: props.userid });
|
||||
if (args?.json?.displayName) {
|
||||
username.value = args.json.displayName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function showUserDialog() {
|
||||
userStore.showUserDialog(props.userid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user