mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-22 08:13:52 +02:00
refactor: app.js (#1291)
* refactor: frontend * Fix avatar gallery sort * Update .NET dependencies * Update npm dependencies electron v37.1.0 * bulkRefreshFriends * fix dark theme * Remove crowdin * Fix config.json dialog not updating * VRCX log file fixes & add Cef log * Remove SharedVariable, fix startup * Revert init theme change * Logging date not working? Fix WinformThemer designer error * Add Cef request hander, no more escaping main page * clean * fix * fix * clean * uh * Apply thememode at startup, fixes random user colours * Split database into files * Instance info remove empty lines * Open external VRC links with VRCX * Electron fixes * fix userdialog style * ohhhh * fix store * fix store * fix: load all group members after kicking a user * fix: world dialog favorite button style * fix: Clear VRCX Cache Timer input value * clean * Fix VR overlay * Fix VR overlay 2 * Fix Discord discord rich presence for RPC worlds * Clean up age verified user tags * Fix playerList being occupied after program reload * no `this` * Fix login stuck loading * writable: false * Hide dialogs on logout * add flush sync option * rm LOGIN event * rm LOGOUT event * remove duplicate event listeners * remove duplicate event listeners * clean * remove duplicate event listeners * clean * fix theme style * fix t * clearable * clean * fix ipcEvent * Small changes * Popcorn Palace support * Remove checkActiveFriends * Clean up * Fix dragEnterCef * Block API requests when not logged in * Clear state on login & logout * Fix worldDialog instances not updating * use <script setup> * Fix avatar change event, CheckGameRunning at startup * Fix image dragging * fix * Remove PWI * fix updateLoop * add webpack-dev-server to dev environment * rm unnecessary chunks * use <script setup> * webpack-dev-server changes * use <script setup> * use <script setup> * Fix UGC text size * Split login event * t * use <script setup> * fix * Update .gitignore and enable checkJs in jsconfig * fix i18n t * use <script setup> * use <script setup> * clean * global types * fix * use checkJs for debugging * Add watchState for login watchers * fix .vue template * type fixes * rm Vue.filter * Cef v138.0.170, VC++ 2022 * Settings fixes * Remove 'USER:CURRENT' * clean up 2FA callbacks * remove userApply * rm i18n import * notification handling to use notification store methods * refactor favorite handling to use favorite store methods and clean up event emissions * refactor moderation handling to use dedicated functions for player moderation events * refactor friend handling to use dedicated functions for friend events * Fix program startup, move lang init * Fix friend state * Fix status change error * Fix user notes diff * fix * rm group event * rm auth event * rm avatar event * clean * clean * getUser * getFriends * getFavoriteWorlds, getFavoriteAvatars * AvatarGalleryUpload btn style & package.json update * Fix friend requests * Apply user * Apply world * Fix note diff * Fix VR overlay * Fixes * Update build scripts * Apply avatar * Apply instance * Apply group * update hidden VRC+ badge * Fix sameInstance "private" * fix 502/504 API errors * fix 502/504 API errors * clean * Fix friend in same instance on orange showing twice in friends list * Add back in broken friend state repair methods * add types --------- Co-authored-by: Natsumi <cmcooper123@hotmail.com>
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import { request } from '../service/request';
|
||||
import { useUserStore } from '../stores';
|
||||
|
||||
function getCurrentUserId() {
|
||||
return useUserStore().currentUser.id;
|
||||
}
|
||||
|
||||
const miscReq = {
|
||||
getBundles(fileId) {
|
||||
return window.API.call(`file/${fileId}`, {
|
||||
return request(`file/${fileId}`, {
|
||||
method: 'GET'
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
@@ -11,7 +18,7 @@ const miscReq = {
|
||||
},
|
||||
|
||||
saveNote(params) {
|
||||
return window.API.call('userNotes', {
|
||||
return request('userNotes', {
|
||||
method: 'POST',
|
||||
params
|
||||
}).then((json) => {
|
||||
@@ -19,7 +26,6 @@ const miscReq = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
// window.API.$emit('NOTE', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
@@ -34,7 +40,7 @@ const miscReq = {
|
||||
* @return { Promise<{json: any, params}> }
|
||||
*/
|
||||
reportUser(params) {
|
||||
return window.API.call(`feedback/${params.userId}/user`, {
|
||||
return request(`feedback/${params.userId}/user`, {
|
||||
method: 'POST',
|
||||
params: {
|
||||
contentType: params.contentType,
|
||||
@@ -46,7 +52,6 @@ const miscReq = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
// window.API.$emit('FEEDBACK:REPORT:USER', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
@@ -59,7 +64,7 @@ const miscReq = {
|
||||
* @return { Promise<{json: any, params}> }
|
||||
*/
|
||||
getFileAnalysis(params) {
|
||||
return window.API.call(
|
||||
return request(
|
||||
`analysis/${params.fileId}/${params.version}/${params.variant}`,
|
||||
{
|
||||
method: 'GET'
|
||||
@@ -69,19 +74,17 @@ const miscReq = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
// window.API.$emit('FILE:ANALYSIS', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
getVRChatCredits() {
|
||||
return window.API.call(`user/${window.API.currentUser.id}/balance`, {
|
||||
return request(`user/${getCurrentUserId()}/balance`, {
|
||||
method: 'GET'
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
json
|
||||
};
|
||||
// window.API.$emit('VRCCREDITS', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
@@ -94,7 +97,7 @@ const miscReq = {
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
closeInstance(params) {
|
||||
return window.API.call(`instances/${params.location}`, {
|
||||
return request(`instances/${params.location}`, {
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
hardClose: params.hardClose ?? false
|
||||
@@ -104,7 +107,6 @@ const miscReq = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
window.API.$emit('INSTANCE:CLOSE', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
@@ -116,8 +118,8 @@ const miscReq = {
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
deleteWorldPersistData(params) {
|
||||
return window.API.call(
|
||||
`users/${window.API.currentUser.id}/${params.worldId}/persist`,
|
||||
return request(
|
||||
`users/${getCurrentUserId()}/${params.worldId}/persist`,
|
||||
{
|
||||
method: 'DELETE'
|
||||
}
|
||||
@@ -126,7 +128,6 @@ const miscReq = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
window.API.$emit('WORLD:PERSIST:DELETE', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
@@ -138,8 +139,8 @@ const miscReq = {
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
hasWorldPersistData(params) {
|
||||
return window.API.call(
|
||||
`users/${window.API.currentUser.id}/${params.worldId}/persist/exists`,
|
||||
return request(
|
||||
`users/${getCurrentUserId()}/${params.worldId}/persist/exists`,
|
||||
{
|
||||
method: 'GET'
|
||||
}
|
||||
@@ -148,47 +149,41 @@ const miscReq = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
window.API.$emit('WORLD:PERSIST:HAS', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
updateBadge(params) {
|
||||
return window.API.call(
|
||||
`users/${window.API.currentUser.id}/badges/${params.badgeId}`,
|
||||
{
|
||||
method: 'PUT',
|
||||
params: {
|
||||
userId: window.API.currentUser.id,
|
||||
badgeId: params.badgeId,
|
||||
hidden: params.hidden,
|
||||
showcased: params.showcased
|
||||
}
|
||||
return request(`users/${getCurrentUserId()}/badges/${params.badgeId}`, {
|
||||
method: 'PUT',
|
||||
params: {
|
||||
userId: getCurrentUserId(),
|
||||
badgeId: params.badgeId,
|
||||
hidden: params.hidden,
|
||||
showcased: params.showcased
|
||||
}
|
||||
).then((json) => {
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
// window.API.$emit('BADGE:UPDATE', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
getVisits() {
|
||||
return window.API.call('visits', {
|
||||
return request('visits', {
|
||||
method: 'GET'
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
json
|
||||
};
|
||||
// window.API.$emit('VISITS', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
deleteFile(fileId) {
|
||||
return window.API.call(`file/${fileId}`, {
|
||||
return request(`file/${fileId}`, {
|
||||
method: 'DELETE'
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
@@ -207,7 +202,7 @@ const miscReq = {
|
||||
// * @returns {Promise<{json: any, params}>}
|
||||
// */
|
||||
// sendBoop(params) {
|
||||
// return window.API.call(`users/${params.userId}/boop`, {
|
||||
// return request(`users/${params.userId}/boop`, {
|
||||
// method: 'POST',
|
||||
// params
|
||||
// }).then((json) => {
|
||||
|
||||
Reference in New Issue
Block a user