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