mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 22:06:06 +02:00
refactor queryRequest
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user