refactor queryRequest

This commit is contained in:
pa
2026-03-09 21:28:45 +09:00
parent c1a35223d4
commit 58b9bdc1c5
60 changed files with 1134 additions and 883 deletions
+10 -8
View File
@@ -23,8 +23,7 @@ import {
friendRequest,
instanceRequest,
notificationRequest,
userRequest,
worldRequest
queryRequest
} from '../../api';
import {
getNotificationMessage,
@@ -216,7 +215,7 @@ export const useNotificationStore = defineStore('Notification', () => {
// get instance name for invite
const L = parseLocation(ref.details.worldId);
if (L.isRealInstance) {
instanceRequest.getCachedInstance({
instanceRequest.getInstance({
worldId: L.worldId,
instanceId: L.instanceId
});
@@ -350,8 +349,8 @@ export const useNotificationStore = defineStore('Notification', () => {
}
const L = parseLocation(currentLocation);
worldRequest
.getCachedWorld({
queryRequest
.fetch('world', {
worldId: L.worldId
})
.then((args1) => {
@@ -401,6 +400,9 @@ export const useNotificationStore = defineStore('Notification', () => {
notificationInitStatus.value = value;
}
/**
*
*/
function clearUnseenNotifications() {
unseenNotifications.value = [];
}
@@ -996,7 +998,7 @@ export const useNotificationStore = defineStore('Notification', () => {
displayOvrtNotification
} = createOverlayDispatch({
getUserIdFromNoty,
userRequest,
queryRequest,
notificationsSettingsStore,
advancedSettingsStore,
appearanceSettingsStore
@@ -1285,8 +1287,8 @@ export const useNotificationStore = defineStore('Notification', () => {
currentLocation = userStore.currentUser?.$locationTag;
}
const L = parseLocation(currentLocation);
worldRequest
.getCachedWorld({ worldId: L.worldId })
queryRequest
.fetch('world', { worldId: L.worldId })
.then((args) => {
notificationRequest
.sendInvite(
+18 -5
View File
@@ -6,10 +6,9 @@ import {
/**
* Creates the overlay dispatch functions for the Notification store.
*
* @param {object} deps
* @param {Function} deps.getUserIdFromNoty
* @param {object} deps.userRequest
* @param {object} deps.queryRequest
* @param {object} deps.notificationsSettingsStore
* @param {object} deps.advancedSettingsStore
* @param {object} deps.appearanceSettingsStore
@@ -17,7 +16,7 @@ import {
*/
export function createOverlayDispatch({
getUserIdFromNoty,
userRequest,
queryRequest,
notificationsSettingsStore,
advancedSettingsStore,
appearanceSettingsStore
@@ -54,6 +53,12 @@ export function createOverlayDispatch({
return imageLocation;
}
/**
*
* @param noty
* @param message
* @param image
*/
function displayDesktopToast(noty, message, image) {
const result = getNotificationMessage(noty, message);
if (result) {
@@ -100,6 +105,14 @@ export function createOverlayDispatch({
AppApi.XSNotification('VRCX', text, timeout, opacity, image);
}
/**
*
* @param playOvrtHudNotifications
* @param playOvrtWristNotifications
* @param noty
* @param message
* @param image
*/
function displayOvrtNotification(
playOvrtHudNotifications,
playOvrtWristNotifications,
@@ -146,8 +159,8 @@ export function createOverlayDispatch({
} else if (noty.imageUrl) {
imageUrl = noty.imageUrl;
} else if (userId && !userId.startsWith('grp_')) {
imageUrl = await userRequest
.getCachedUser({
imageUrl = await queryRequest
.fetch('user', {
userId
})
.catch((err) => {