mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 13:56:07 +02:00
refactor
This commit is contained in:
@@ -90,23 +90,23 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
|
||||
const favoriteFriends = computed(() => {
|
||||
if (appearanceSettingsStore.sortFavorites) {
|
||||
return state.favoriteFriends_.sort(compareByFavoriteSortOrder);
|
||||
return state.favoriteFriends_.toSorted(compareByFavoriteSortOrder);
|
||||
}
|
||||
return state.favoriteFriends_.sort(compareByName);
|
||||
return state.favoriteFriends_.toSorted(compareByName);
|
||||
});
|
||||
|
||||
const favoriteWorlds = computed(() => {
|
||||
if (appearanceSettingsStore.sortFavorites) {
|
||||
return state.favoriteWorlds_.sort(compareByFavoriteSortOrder);
|
||||
return state.favoriteWorlds_.toSorted(compareByFavoriteSortOrder);
|
||||
}
|
||||
return state.favoriteWorlds_.sort(compareByName);
|
||||
return state.favoriteWorlds_.toSorted(compareByName);
|
||||
});
|
||||
|
||||
const favoriteAvatars = computed(() => {
|
||||
if (appearanceSettingsStore.sortFavorites) {
|
||||
return state.favoriteAvatars_.sort(compareByFavoriteSortOrder);
|
||||
return state.favoriteAvatars_.toSorted(compareByFavoriteSortOrder);
|
||||
}
|
||||
return state.favoriteAvatars_.sort(compareByName);
|
||||
return state.favoriteAvatars_.toSorted(compareByName);
|
||||
});
|
||||
|
||||
watch(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
import { getSentry, isSentryOptedIn } from '../plugins';
|
||||
import { createPiniaActionTrailPlugin } from '../plugins/piniaActionTrail';
|
||||
import { useAdvancedSettingsStore } from './settings/advanced';
|
||||
import { useAppearanceSettingsStore } from './settings/appearance';
|
||||
import { useAuthStore } from './auth';
|
||||
@@ -43,11 +42,6 @@ import { useWristOverlaySettingsStore } from './settings/wristOverlay';
|
||||
|
||||
export const pinia = createPinia();
|
||||
|
||||
function registerPiniaActionTrailPlugin() {
|
||||
if (!NIGHTLY) return;
|
||||
pinia.use(createPiniaActionTrailPlugin({ maxEntries: 200 }));
|
||||
}
|
||||
|
||||
async function registerSentryPiniaPlugin() {
|
||||
if (!NIGHTLY) return;
|
||||
if (!(await isSentryOptedIn())) return;
|
||||
@@ -125,9 +119,6 @@ async function registerSentryPiniaPlugin() {
|
||||
|
||||
export async function initPiniaPlugins() {
|
||||
await registerSentryPiniaPlugin();
|
||||
setTimeout(() => {
|
||||
registerPiniaActionTrailPlugin();
|
||||
}, 60000);
|
||||
}
|
||||
|
||||
export function createGlobalStores() {
|
||||
|
||||
+1
-18
@@ -10,10 +10,6 @@ import {
|
||||
SEARCH_LIMIT_MIN
|
||||
} from '../shared/constants';
|
||||
import { avatarRequest, queryRequest } from '../api';
|
||||
import {
|
||||
clearPiniaActionTrail,
|
||||
getPiniaActionTrail
|
||||
} from '../plugins/piniaActionTrail';
|
||||
import { debounce, parseLocation } from '../shared/utils';
|
||||
import { AppDebug } from '../services/appConfig';
|
||||
import { database } from '../services/database';
|
||||
@@ -556,29 +552,16 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
if (advancedSettingsStore.sentryErrorReporting) {
|
||||
try {
|
||||
import('@sentry/vue').then((Sentry) => {
|
||||
const trail = getPiniaActionTrail()
|
||||
.filter((entry) => {
|
||||
if (!entry) return false;
|
||||
return (
|
||||
typeof entry.t === 'string' &&
|
||||
typeof entry.a === 'string'
|
||||
);
|
||||
})
|
||||
.reverse();
|
||||
const trailText = JSON.stringify(trail);
|
||||
Sentry.withScope((scope) => {
|
||||
scope.setLevel('fatal');
|
||||
scope.setTag('reason', 'crash-recovery');
|
||||
scope.setContext('pinia_actions', {
|
||||
trailText,
|
||||
scope.setContext('session', {
|
||||
sessionTime: performance.now() / 1000 / 60
|
||||
});
|
||||
Sentry.captureMessage(
|
||||
`crash message: ${crashMessage}`
|
||||
);
|
||||
});
|
||||
|
||||
clearPiniaActionTrail();
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error setting up Sentry feedback:', error);
|
||||
|
||||
Reference in New Issue
Block a user