mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-14 04:13:52 +02:00
fix crash report
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div v-if="isVisible" :class="['inline-block']">
|
||||
<TooltipWrapper v-if="!canOpenInstanceInGame" side="top" :content="t('dialog.user.info.self_invite_tooltip')">
|
||||
<Button
|
||||
class="rounded-full h-6 w-6 text-xs"
|
||||
class="rounded-full h-6 w-6 text-xs text-muted-foreground hover:text-foreground"
|
||||
size="icon-sm"
|
||||
variant="outline"
|
||||
v-show="isVisible"
|
||||
@@ -11,10 +11,19 @@
|
||||
></Button>
|
||||
</TooltipWrapper>
|
||||
<TooltipWrapper v-else side="top" :content="t('dialog.user.info.open_in_vrchat_tooltip')">
|
||||
<Button class="rounded-full h-6 w-6 text-xs" size="icon-sm" variant="outline" v-if="isOpeningInstance">
|
||||
<Button
|
||||
class="rounded-full h-6 w-6 text-xs text-muted-foreground hover:text-foreground"
|
||||
size="icon-sm"
|
||||
variant="outline"
|
||||
v-if="isOpeningInstance">
|
||||
<i class="ri-loader-line"></i>
|
||||
</Button>
|
||||
<Button class="rounded-full h-6 w-6 text-xs" size="icon-sm" variant="outline" v-else @click="openInstance"
|
||||
<Button
|
||||
class="rounded-full h-6 w-6 text-xs text-muted-foreground hover:text-foreground"
|
||||
size="icon-sm"
|
||||
variant="outline"
|
||||
v-else
|
||||
@click="openInstance"
|
||||
><i class="ri-mail-line"></i
|
||||
></Button>
|
||||
</TooltipWrapper>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const STORAGE_KEY = 'vrcx:sentry:piniaActions';
|
||||
const DEFAULT_MAX_ENTRIES = 200;
|
||||
|
||||
function getStorage() {
|
||||
try {
|
||||
@@ -41,15 +42,17 @@ export function clearPiniaActionTrail() {
|
||||
storage.removeItem(STORAGE_KEY);
|
||||
}
|
||||
|
||||
export function appendPiniaActionTrail(entry) {
|
||||
export function appendPiniaActionTrail(entry, options) {
|
||||
const storage = getStorage();
|
||||
if (!storage) return;
|
||||
|
||||
const maxEntries = options?.maxEntries ?? DEFAULT_MAX_ENTRIES;
|
||||
|
||||
const existing = getPiniaActionTrail();
|
||||
existing.push(entry);
|
||||
|
||||
if (existing.length > 200) {
|
||||
existing.splice(0, existing.length - 200);
|
||||
if (existing.length > maxEntries) {
|
||||
existing.splice(0, existing.length - maxEntries);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -59,13 +62,17 @@ export function appendPiniaActionTrail(entry) {
|
||||
}
|
||||
}
|
||||
|
||||
export function createPiniaActionTrailPlugin() {
|
||||
export function createPiniaActionTrailPlugin(options) {
|
||||
const maxEntries = options?.maxEntries ?? DEFAULT_MAX_ENTRIES;
|
||||
return ({ store }) => {
|
||||
store.$onAction(({ name }) => {
|
||||
appendPiniaActionTrail({
|
||||
t: dayjs().format('HH:mm:ss'),
|
||||
a: name
|
||||
});
|
||||
appendPiniaActionTrail(
|
||||
{
|
||||
t: dayjs().format('HH:mm:ss'),
|
||||
a: name
|
||||
},
|
||||
{ maxEntries }
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import Noty from 'noty';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
clearPiniaActionTrail,
|
||||
@@ -532,16 +531,12 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
if (advancedSettingsStore.sentryErrorReporting) {
|
||||
try {
|
||||
import('@sentry/vue').then((Sentry) => {
|
||||
const cutoff = dayjs().subtract(30, 'minute');
|
||||
const trail = getPiniaActionTrail().filter((entry) => {
|
||||
if (!entry || typeof entry.ts !== 'number') {
|
||||
return false;
|
||||
}
|
||||
const ts = dayjs(entry.ts);
|
||||
if (!ts.isValid()) {
|
||||
return false;
|
||||
}
|
||||
return ts.isAfter(cutoff) || ts.isSame(cutoff);
|
||||
if (!entry) return false;
|
||||
return (
|
||||
typeof entry.t === 'string' &&
|
||||
typeof entry.a === 'string'
|
||||
);
|
||||
});
|
||||
const trailText = JSON.stringify(trail);
|
||||
Sentry.withScope((scope) => {
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
<div v-show="!isSidebarGroupByInstanceCollapsed">
|
||||
<div v-for="friendArr in friendsInSameInstance" :key="friendArr[0].ref.$location.tag">
|
||||
<div class="mb-1 flex items-center">
|
||||
<div class="mb-1 flex items-center text-neutral-300">
|
||||
<Location class="extra" :location="getFriendsLocations(friendArr)" style="display: inline" />
|
||||
<span class="extra" style="margin-left: 5px">{{ `(${friendArr.length})` }}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user