mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
rewrite web request logging function
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
storeAvatarImage
|
||||
} from '../shared/utils';
|
||||
import { avatarRequest, miscRequest, queryRequest } from '../api';
|
||||
import { AppDebug } from '../services/appConfig';
|
||||
import { logWebRequest } from '../services/appConfig';
|
||||
import { database } from '../services/database';
|
||||
import { patchAvatarFromEvent } from '../queries';
|
||||
import { processBulk } from '../services/request';
|
||||
@@ -295,9 +295,7 @@ export async function lookupAvatars(type, search) {
|
||||
}
|
||||
});
|
||||
const json = JSON.parse(response.data);
|
||||
if (AppDebug.debugWebRequests) {
|
||||
console.log(url, json, response);
|
||||
}
|
||||
logWebRequest('[EXTERNAL GET]', url, `(${response.status})`, json);
|
||||
if (response.status === 200 && typeof json === 'object') {
|
||||
json.forEach((avatar) => {
|
||||
if (!avatars.has(avatar.Id)) {
|
||||
@@ -386,9 +384,7 @@ async function lookupAvatarByFileId(providerUrl, fileId) {
|
||||
}
|
||||
});
|
||||
const json = JSON.parse(response.data);
|
||||
if (AppDebug.debugWebRequests) {
|
||||
console.log(url, json, response);
|
||||
}
|
||||
logWebRequest('[EXTERNAL GET]', url, `(${response.status})`, json);
|
||||
if (response.status === 200 && typeof json === 'object') {
|
||||
const ref = {
|
||||
authorId: '',
|
||||
@@ -436,9 +432,7 @@ async function lookupAvatarsByAuthor(providerUrl, authorId) {
|
||||
}
|
||||
});
|
||||
const json = JSON.parse(response.data);
|
||||
if (AppDebug.debugWebRequests) {
|
||||
console.log(url, json, response);
|
||||
}
|
||||
logWebRequest('[EXTERNAL GET]', url, `(${response.status})`, json);
|
||||
if (response.status === 200 && typeof json === 'object') {
|
||||
json.forEach((avatar) => {
|
||||
const ref = {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
replaceBioSymbols
|
||||
} from '../shared/utils';
|
||||
import { i18n } from '../plugins/i18n';
|
||||
import { AppDebug } from '../services/appConfig';
|
||||
import { AppDebug, logWebRequest } from '../services/appConfig';
|
||||
import { database } from '../services/database';
|
||||
import {
|
||||
runLastLocationResetFlow,
|
||||
@@ -334,9 +334,7 @@ export function addGameLogEntry(gameLog, location) {
|
||||
vrcxStore.processScreenshot(gameLog.screenshotPath);
|
||||
break;
|
||||
case 'api-request':
|
||||
if (AppDebug.debugWebRequests) {
|
||||
console.log('API Request:', gameLog.url);
|
||||
}
|
||||
logWebRequest('[GAMELOG API]', gameLog.url);
|
||||
if (advancedSettingsStore.saveInstanceEmoji) {
|
||||
const inv = parseInventoryFromUrl(gameLog.url);
|
||||
if (inv) {
|
||||
|
||||
Reference in New Issue
Block a user