mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 01:03:50 +02:00
fix mutuals chart by filtering out invalid user IDs
This commit is contained in:
@@ -16,6 +16,19 @@ function createDefaultFetchState() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const EMPTY_USER_ID = 'usr_00000000-0000-0000-0000-000000000000';
|
||||||
|
|
||||||
|
function normalizeIdentifier(value) {
|
||||||
|
if (typeof value === 'string') return value;
|
||||||
|
if (value === undefined || value === null) return '';
|
||||||
|
return String(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidMutualIdentifier(value) {
|
||||||
|
const identifier = normalizeIdentifier(value);
|
||||||
|
return Boolean(identifier && identifier !== EMPTY_USER_ID);
|
||||||
|
}
|
||||||
|
|
||||||
export const useChartsStore = defineStore('Charts', () => {
|
export const useChartsStore = defineStore('Charts', () => {
|
||||||
const friendStore = useFriendStore();
|
const friendStore = useFriendStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
@@ -176,7 +189,11 @@ export const useChartsStore = defineStore('Charts', () => {
|
|||||||
|
|
||||||
if (!args || isCancelled()) break;
|
if (!args || isCancelled()) break;
|
||||||
|
|
||||||
collected.push(...args.json);
|
collected.push(
|
||||||
|
...args.json.filter((entry) =>
|
||||||
|
isValidMutualIdentifier(entry?.id)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (args.json.length < 100) break;
|
if (args.json.length < 100) break;
|
||||||
offset += args.json.length;
|
offset += args.json.length;
|
||||||
@@ -259,17 +276,8 @@ export const useChartsStore = defineStore('Charts', () => {
|
|||||||
const ids = [];
|
const ids = [];
|
||||||
|
|
||||||
for (const entry of collection) {
|
for (const entry of collection) {
|
||||||
const identifier =
|
const identifier = normalizeIdentifier(entry?.id);
|
||||||
typeof entry?.id === 'string'
|
if (isValidMutualIdentifier(identifier))
|
||||||
? entry.id
|
|
||||||
: entry?.id !== undefined && entry?.id !== null
|
|
||||||
? String(entry.id)
|
|
||||||
: '';
|
|
||||||
if (
|
|
||||||
identifier &&
|
|
||||||
identifier !==
|
|
||||||
'usr_00000000-0000-0000-0000-000000000000'
|
|
||||||
)
|
|
||||||
ids.push(identifier);
|
ids.push(identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -381,7 +381,7 @@
|
|||||||
|
|
||||||
import AvatarProviderDialog from '../../dialogs/AvatarProviderDialog.vue';
|
import AvatarProviderDialog from '../../dialogs/AvatarProviderDialog.vue';
|
||||||
import PhotonSettings from '../PhotonSettings.vue';
|
import PhotonSettings from '../PhotonSettings.vue';
|
||||||
import RegistryBackupDialog from '../../dialogs/RegistryBackupDialog.vue';
|
import RegistryBackupDialog from '../../../Tools/dialogs/RegistryBackupDialog.vue';
|
||||||
import SimpleSwitch from '../SimpleSwitch.vue';
|
import SimpleSwitch from '../SimpleSwitch.vue';
|
||||||
import TranslationApiDialog from '../../dialogs/TranslationApiDialog.vue';
|
import TranslationApiDialog from '../../dialogs/TranslationApiDialog.vue';
|
||||||
import YouTubeApiDialog from '../../dialogs/YouTubeApiDialog.vue';
|
import YouTubeApiDialog from '../../dialogs/YouTubeApiDialog.vue';
|
||||||
|
|||||||
@@ -337,7 +337,7 @@
|
|||||||
SquarePen,
|
SquarePen,
|
||||||
UserCheck
|
UserCheck
|
||||||
} from 'lucide-vue-next';
|
} from 'lucide-vue-next';
|
||||||
import { computed, defineAsyncComponent, ref } from 'vue';
|
import { computed, defineAsyncComponent, onMounted, ref } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { Card } from '@/components/ui/card';
|
import { Card } from '@/components/ui/card';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
@@ -350,6 +350,7 @@
|
|||||||
import { useVrcxStore } from '../../stores/vrcx';
|
import { useVrcxStore } from '../../stores/vrcx';
|
||||||
|
|
||||||
import AutoChangeStatusDialog from './dialogs/AutoChangeStatusDialog.vue';
|
import AutoChangeStatusDialog from './dialogs/AutoChangeStatusDialog.vue';
|
||||||
|
import configRepository from '../../service/config.js';
|
||||||
|
|
||||||
const GroupCalendarDialog = defineAsyncComponent(() => import('./dialogs/GroupCalendarDialog.vue'));
|
const GroupCalendarDialog = defineAsyncComponent(() => import('./dialogs/GroupCalendarDialog.vue'));
|
||||||
const NoteExportDialog = defineAsyncComponent(() => import('./dialogs/NoteExportDialog.vue'));
|
const NoteExportDialog = defineAsyncComponent(() => import('./dialogs/NoteExportDialog.vue'));
|
||||||
@@ -357,7 +358,7 @@
|
|||||||
const ExportDiscordNamesDialog = defineAsyncComponent(() => import('./dialogs/ExportDiscordNamesDialog.vue'));
|
const ExportDiscordNamesDialog = defineAsyncComponent(() => import('./dialogs/ExportDiscordNamesDialog.vue'));
|
||||||
const ExportFriendsListDialog = defineAsyncComponent(() => import('./dialogs/ExportFriendsListDialog.vue'));
|
const ExportFriendsListDialog = defineAsyncComponent(() => import('./dialogs/ExportFriendsListDialog.vue'));
|
||||||
const ExportAvatarsListDialog = defineAsyncComponent(() => import('./dialogs/ExportAvatarsListDialog.vue'));
|
const ExportAvatarsListDialog = defineAsyncComponent(() => import('./dialogs/ExportAvatarsListDialog.vue'));
|
||||||
const RegistryBackupDialog = defineAsyncComponent(() => import('../Settings/dialogs/RegistryBackupDialog.vue'));
|
const RegistryBackupDialog = defineAsyncComponent(() => import('./dialogs/RegistryBackupDialog.vue'));
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -368,6 +369,7 @@
|
|||||||
const { showVRChatConfig } = useAdvancedSettingsStore();
|
const { showVRChatConfig } = useAdvancedSettingsStore();
|
||||||
const { showLaunchOptions } = useLaunchStore();
|
const { showLaunchOptions } = useLaunchStore();
|
||||||
const { showRegistryBackupDialog } = useVrcxStore();
|
const { showRegistryBackupDialog } = useVrcxStore();
|
||||||
|
const toolsCategoryCollapsedConfigKey = 'VRCX_toolsCategoryCollapsed';
|
||||||
|
|
||||||
const categoryCollapsed = ref({
|
const categoryCollapsed = ref({
|
||||||
group: false,
|
group: false,
|
||||||
@@ -401,8 +403,22 @@
|
|||||||
|
|
||||||
const toggleCategory = (category) => {
|
const toggleCategory = (category) => {
|
||||||
categoryCollapsed.value[category] = !categoryCollapsed.value[category];
|
categoryCollapsed.value[category] = !categoryCollapsed.value[category];
|
||||||
|
configRepository.setString(toolsCategoryCollapsedConfigKey, JSON.stringify(categoryCollapsed.value));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const storedValue = await configRepository.getString(toolsCategoryCollapsedConfigKey, '{}');
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(storedValue);
|
||||||
|
categoryCollapsed.value = {
|
||||||
|
...categoryCollapsed.value,
|
||||||
|
...parsed
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
// ignore invalid stored value and keep defaults
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const showEditInviteMessageDialog = () => {
|
const showEditInviteMessageDialog = () => {
|
||||||
isEditInviteMessagesDialogVisible.value = true;
|
isEditInviteMessagesDialogVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
import { useAdvancedSettingsStore, useModalStore, useVrcxStore } from '../../../stores';
|
import { useAdvancedSettingsStore, useModalStore, useVrcxStore } from '../../../stores';
|
||||||
import { downloadAndSaveJson, removeFromArray } from '../../../shared/utils';
|
import { downloadAndSaveJson, removeFromArray } from '../../../shared/utils';
|
||||||
import { Switch } from '../../../components/ui/switch';
|
import { Switch } from '../../../components/ui/switch';
|
||||||
import { createColumns } from './registryBackupColumns.jsx';
|
import { createColumns } from '../../Settings/dialogs/registryBackupColumns.jsx';
|
||||||
import { useVrcxVueTable } from '../../../lib/table/useVrcxVueTable';
|
import { useVrcxVueTable } from '../../../lib/table/useVrcxVueTable';
|
||||||
|
|
||||||
import configRepository from '../../../service/config';
|
import configRepository from '../../../service/config';
|
||||||
Reference in New Issue
Block a user