mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 09:13:50 +02:00
refactor store
This commit is contained in:
@@ -28,9 +28,10 @@
|
||||
import { timeToText } from '../../../shared/utils';
|
||||
|
||||
import * as echarts from 'echarts';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const { isDarkMode, dtHour12 } = storeToRefs(useAppearanceSettingsStore());
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { currentUser } = storeToRefs(useUserStore());
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -275,6 +275,7 @@
|
||||
useUserStore
|
||||
} from '../../../stores';
|
||||
import { userImage, userStatusClass } from '../../../shared/utils';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
import { database } from '../../../service/database';
|
||||
import { watchState } from '../../../service/watchState';
|
||||
|
||||
@@ -290,7 +291,7 @@
|
||||
const { currentUser } = storeToRefs(userStore);
|
||||
const { isDarkMode } = storeToRefs(appearanceStore);
|
||||
const cachedUsers = userStore.cachedUsers;
|
||||
const showUserDialog = (userId) => userStore.showUserDialog(userId);
|
||||
|
||||
|
||||
const fetchState = chartsStore.mutualGraphFetchState;
|
||||
const status = chartsStore.mutualGraphStatus;
|
||||
|
||||
@@ -519,7 +519,7 @@
|
||||
handleFavoriteGroup
|
||||
} = favoriteStore;
|
||||
const { avatarHistory } = storeToRefs(useAvatarStore());
|
||||
const { promptClearAvatarHistory, showAvatarDialog, applyAvatar } = useAvatarStore();
|
||||
import { promptClearAvatarHistory, showAvatarDialog, applyAvatar } from '../../coordinators/avatarCoordinator';
|
||||
const { isLocalUserVrcPlusSupporter } = storeToRefs(useUserStore());
|
||||
const { t } = useI18n();
|
||||
|
||||
|
||||
@@ -388,6 +388,7 @@
|
||||
DropdownMenuTrigger
|
||||
} from '../../components/ui/dropdown-menu';
|
||||
import { useAppearanceSettingsStore, useFavoriteStore, useModalStore, useWorldStore } from '../../stores';
|
||||
import { showWorldDialog } from '../../coordinators/worldCoordinator';
|
||||
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '../../components/ui/resizable';
|
||||
import { favoriteRequest, worldRequest } from '../../api';
|
||||
import { debounce } from '../../shared/utils';
|
||||
@@ -436,7 +437,7 @@
|
||||
handleFavoriteGroup,
|
||||
localWorldFavoritesList
|
||||
} = favoriteStore;
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
|
||||
|
||||
const {
|
||||
cardScale: worldCardScale,
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
const { favoriteAvatarGroups } = storeToRefs(useFavoriteStore());
|
||||
const { showFavoriteDialog } = useFavoriteStore();
|
||||
const { selectAvatarWithConfirmation } = useAvatarStore();
|
||||
import { selectAvatarWithConfirmation } from '../../../coordinators/avatarCoordinator';
|
||||
const { shiftHeld } = storeToRefs(useUiStore());
|
||||
const { currentUser } = storeToRefs(useUserStore());
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
const { t } = useI18n();
|
||||
|
||||
const { showFavoriteDialog, getCachedFavoritesByObjectId } = useFavoriteStore();
|
||||
const { selectAvatarWithConfirmation } = useAvatarStore();
|
||||
import { selectAvatarWithConfirmation } from '../../../coordinators/avatarCoordinator';
|
||||
const { currentUser } = storeToRefs(useUserStore());
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -131,11 +131,12 @@
|
||||
|
||||
const emit = defineEmits(['update:avatarImportDialogInput']);
|
||||
const { t } = useI18n();
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { favoriteAvatarGroups, avatarImportDialogInput, avatarImportDialogVisible, localAvatarFavoriteGroups } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
const { localAvatarFavGroupLength, getCachedFavoritesByObjectId } = useFavoriteStore();
|
||||
const { showAvatarDialog, applyAvatar } = useAvatarStore();
|
||||
import { showAvatarDialog, applyAvatar } from '../../../coordinators/avatarCoordinator';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
|
||||
const avatarImportDialog = ref({
|
||||
|
||||
@@ -131,12 +131,13 @@
|
||||
import { favoriteRequest, userRequest } from '../../../api';
|
||||
import { createColumns } from './friendImportColumns.jsx';
|
||||
import { useVrcxVueTable } from '../../../lib/table/useVrcxVueTable';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const emit = defineEmits(['update:friendImportDialogInput']);
|
||||
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { favoriteFriendGroups, friendImportDialogInput, friendImportDialogVisible, localFriendFavoriteGroups } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
|
||||
@@ -127,17 +127,19 @@
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useFavoriteStore, useGalleryStore, useUserStore, useWorldStore } from '../../../stores';
|
||||
import { showWorldDialog } from '../../../coordinators/worldCoordinator';
|
||||
import { addLocalWorldFavorite } from '../../../coordinators/favoriteCoordinator';
|
||||
import { favoriteRequest, worldRequest } from '../../../api';
|
||||
import { createColumns } from './worldImportColumns.jsx';
|
||||
import { removeFromArray } from '../../../shared/utils';
|
||||
import { useVrcxVueTable } from '../../../lib/table/useVrcxVueTable';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { favoriteWorldGroups, worldImportDialogInput, worldImportDialogVisible, localWorldFavoriteGroups } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
const { localWorldFavGroupLength, getCachedFavoritesByObjectId } = useFavoriteStore();
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
|
||||
const emit = defineEmits(['update:worldImportDialogInput']);
|
||||
|
||||
@@ -16,7 +16,8 @@ import {
|
||||
} from 'lucide-vue-next';
|
||||
import { formatDateFilter, statusClass, timeToText } from '../../shared/utils';
|
||||
import { i18n } from '../../plugin';
|
||||
import { useUserStore, useGalleryStore } from '../../stores';
|
||||
import { useGalleryStore } from '../../stores';
|
||||
import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = i18n.global;
|
||||
|
||||
@@ -276,7 +277,7 @@ export const columns = [
|
||||
header: () => t('table.feed.user'),
|
||||
meta: { label: () => t('table.feed.user') },
|
||||
cell: ({ row }) => {
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const original = row.original;
|
||||
return (
|
||||
<span
|
||||
|
||||
@@ -148,6 +148,7 @@
|
||||
import { router } from '../../plugin/router';
|
||||
import { useDataTableScrollHeight } from '../../composables/useDataTableScrollHeight';
|
||||
import { useVrcxVueTable } from '../../lib/table/useVrcxVueTable';
|
||||
import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -158,7 +159,7 @@
|
||||
const { getAllUserStats, getAllUserMutualCount, confirmDeleteFriend, handleFriendDelete } = useFriendStore();
|
||||
const appearanceSettingsStore = useAppearanceSettingsStore();
|
||||
const { randomUserColours } = storeToRefs(appearanceSettingsStore);
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { stringComparer, friendsListSearch } = storeToRefs(useSearchStore());
|
||||
|
||||
const friendsListSearchFilters = ref([]);
|
||||
|
||||
@@ -10,12 +10,13 @@ import { storeToRefs } from 'pinia';
|
||||
|
||||
import { formatDateFilter } from '../../shared/utils';
|
||||
import { i18n } from '../../plugin';
|
||||
import { useUiStore, useUserStore } from '../../stores';
|
||||
import { useUiStore } from '../../stores';
|
||||
import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = i18n.global;
|
||||
|
||||
export const createColumns = ({ onDelete, onDeletePrompt }) => {
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { shiftHeld } = storeToRefs(useUiStore());
|
||||
|
||||
return [
|
||||
|
||||
@@ -81,9 +81,10 @@
|
||||
import { checkCanInvite, checkCanInviteSelf } from '../../../shared/utils/invite.js';
|
||||
|
||||
import Location from '../../../components/Location.vue';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { showUserDialog, showSendBoopDialog } = useUserStore();
|
||||
const { showSendBoopDialog } = useUserStore();
|
||||
const launchStore = useLaunchStore();
|
||||
const { lastLocation, lastLocationDestination } = storeToRefs(useLocationStore());
|
||||
const { isGameRunning } = storeToRefs(useGameStore());
|
||||
|
||||
@@ -9,10 +9,10 @@ import { formatDateFilter, openExternalLink } from '../../shared/utils';
|
||||
import { i18n } from '../../plugin';
|
||||
import {
|
||||
useInstanceStore,
|
||||
useUiStore,
|
||||
useUserStore,
|
||||
useWorldStore
|
||||
useUiStore
|
||||
} from '../../stores';
|
||||
import { lookupUser } from '../../coordinators/userCoordinator';
|
||||
import { showWorldDialog } from '../../coordinators/worldCoordinator';
|
||||
|
||||
const { t } = i18n.global;
|
||||
|
||||
@@ -24,8 +24,9 @@ const UNACTIONABLE_TYPES = new Set([
|
||||
]);
|
||||
|
||||
export const createColumns = ({ getCreatedAt, onDelete, onDeletePrompt }) => {
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
const { lookupUser } = useUserStore();
|
||||
|
||||
|
||||
|
||||
const { showPreviousInstancesInfoDialog } = useInstanceStore();
|
||||
const { shiftHeld } = storeToRefs(useUiStore());
|
||||
|
||||
|
||||
@@ -11,11 +11,12 @@ import { storeToRefs } from 'pinia';
|
||||
import { formatDateFilter } from '../../shared/utils';
|
||||
import { i18n } from '../../plugin';
|
||||
import { useUiStore, useUserStore } from '../../stores';
|
||||
import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
|
||||
const { t, te } = i18n.global;
|
||||
|
||||
export const createColumns = ({ onDelete, onDeletePrompt }) => {
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { shiftHeld } = storeToRefs(useUiStore());
|
||||
const { currentUser } = storeToRefs(useUserStore());
|
||||
|
||||
|
||||
@@ -347,12 +347,13 @@
|
||||
import ManageTagsDialog from './ManageTagsDialog.vue';
|
||||
import MyAvatarCard from './components/MyAvatarCard.vue';
|
||||
import configRepository from '../../service/config.js';
|
||||
import { showAvatarDialog, selectAvatarWithoutConfirmation, applyAvatar } from '../../coordinators/avatarCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
const appearanceSettingsStore = useAppearanceSettingsStore();
|
||||
const avatarStore = useAvatarStore();
|
||||
const modalStore = useModalStore();
|
||||
const { showAvatarDialog, selectAvatarWithoutConfirmation, applyAvatar } = avatarStore;
|
||||
|
||||
const { currentUser } = storeToRefs(useUserStore());
|
||||
|
||||
const pageSizes = computed(() => appearanceSettingsStore.tablePageSizes);
|
||||
|
||||
@@ -31,13 +31,14 @@ import { checkCanInvite, formatDateFilter } from '../../shared/utils';
|
||||
import { i18n } from '../../plugin';
|
||||
import {
|
||||
useGameStore,
|
||||
useGroupStore,
|
||||
useLocationStore,
|
||||
useUiStore,
|
||||
useUserStore,
|
||||
useWorldStore,
|
||||
useNotificationStore
|
||||
} from '../../stores';
|
||||
import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
import { showWorldDialog } from '../../coordinators/worldCoordinator';
|
||||
import { showGroupDialog } from '../../coordinators/groupCoordinator';
|
||||
|
||||
import Emoji from '../../components/Emoji.vue';
|
||||
|
||||
@@ -61,9 +62,8 @@ export const createColumns = ({
|
||||
deleteNotificationLog,
|
||||
deleteNotificationLogPrompt
|
||||
}) => {
|
||||
const { showUserDialog, showSendBoopDialog } = useUserStore();
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
const { showGroupDialog } = useGroupStore();
|
||||
const { showSendBoopDialog } = useUserStore();
|
||||
|
||||
const { shiftHeld } = storeToRefs(useUiStore());
|
||||
const { currentUser } = storeToRefs(useUserStore());
|
||||
const { lastLocation } = storeToRefs(useLocationStore());
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
|
||||
import ChatboxBlacklistDialog from './dialogs/ChatboxBlacklistDialog.vue';
|
||||
import Timer from '../../components/Timer.vue';
|
||||
import { showUserDialog, lookupUser } from '../../coordinators/userCoordinator';
|
||||
|
||||
const PhotonEventTable = defineAsyncComponent(() => import('./components/PhotonEventTable.vue'));
|
||||
|
||||
@@ -203,7 +204,7 @@
|
||||
const photonStore = usePhotonStore();
|
||||
const { photonLoggingEnabled, chatboxUserBlacklist } = storeToRefs(photonStore);
|
||||
const { saveChatboxUserBlacklist } = photonStore;
|
||||
const { showUserDialog, lookupUser } = useUserStore();
|
||||
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
const { lastLocation } = storeToRefs(useLocationStore());
|
||||
const { currentInstanceLocation, currentInstanceWorld, currentInstanceUsersData } = storeToRefs(useInstanceStore());
|
||||
|
||||
@@ -83,9 +83,11 @@
|
||||
useVrcxStore,
|
||||
useWorldStore
|
||||
} from '../../../stores';
|
||||
import { showWorldDialog } from '../../../coordinators/worldCoordinator';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../components/ui/select';
|
||||
import { createColumns } from './photonEventColumns.jsx';
|
||||
import { photonEventTableTypeFilterList } from '../../../shared/constants/photon';
|
||||
import { lookupUser } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const emit = defineEmits(['show-chatbox-blacklist']);
|
||||
const { t } = useI18n();
|
||||
@@ -106,9 +108,9 @@
|
||||
|
||||
const { stringComparer } = storeToRefs(useSearchStore());
|
||||
|
||||
const { lookupUser } = useUserStore();
|
||||
|
||||
const { showAvatarDialog } = useAvatarStore();
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
|
||||
const { showGroupDialog } = useGroupStore();
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
const { ipcEnabled } = storeToRefs(useVrcxStore());
|
||||
|
||||
@@ -402,13 +402,14 @@
|
||||
userImage
|
||||
} from '../../shared/utils';
|
||||
import { groupRequest, worldRequest } from '../../api';
|
||||
import { showUserDialog, refreshUserDialogAvatars } from '../../coordinators/userCoordinator';
|
||||
|
||||
const { randomUserColours } = storeToRefs(useAppearanceSettingsStore());
|
||||
const { avatarRemoteDatabase } = storeToRefs(useAdvancedSettingsStore());
|
||||
const { avatarRemoteDatabaseProviderList, avatarRemoteDatabaseProvider } = storeToRefs(useAvatarProviderStore());
|
||||
const { setAvatarProvider } = useAvatarProviderStore();
|
||||
const { userDialog } = storeToRefs(useUserStore());
|
||||
const { showUserDialog, refreshUserDialogAvatars } = useUserStore();
|
||||
|
||||
const { showAvatarDialog, lookupAvatars, cachedAvatars } = useAvatarStore();
|
||||
const { cachedWorlds, showWorldDialog } = useWorldStore();
|
||||
const { showGroupDialog } = useGroupStore();
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
import { userImage, userStatusClass } from '../../../shared/utils';
|
||||
|
||||
import '@/styles/status-icon.css';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const props = defineProps({
|
||||
friend: { type: Object, required: true },
|
||||
@@ -89,7 +90,7 @@
|
||||
const { hideNicknames } = storeToRefs(useAppearanceSettingsStore());
|
||||
const { isRefreshFriendsLoading, allFavoriteFriendIds } = storeToRefs(useFriendStore());
|
||||
const { confirmDeleteFriend } = useFriendStore();
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const isFriendTraveling = computed(() => props.friend.ref?.location === 'traveling');
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
import configRepository from '../../../service/config';
|
||||
|
||||
import '@/styles/status-icon.css';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -238,7 +239,7 @@
|
||||
sidebarSortMethods
|
||||
} = storeToRefs(appearanceSettingsStore);
|
||||
const { gameLogDisabled } = storeToRefs(useAdvancedSettingsStore());
|
||||
const { showUserDialog, showSendBoopDialog } = useUserStore();
|
||||
const { showSendBoopDialog } = useUserStore();
|
||||
const launchStore = useLaunchStore();
|
||||
const { favoriteFriendGroups, groupedByGroupKeyFavoriteFriends, localFriendFavorites } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
|
||||
@@ -255,6 +255,8 @@
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { useGameStore, useGroupStore, useLocationStore, useNotificationStore, useUserStore } from '../../../stores';
|
||||
import { showGroupDialog } from '../../../coordinators/groupCoordinator';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
import { checkCanInvite, userImage } from '../../../shared/utils';
|
||||
|
||||
import Location from '../../../components/Location.vue';
|
||||
@@ -461,13 +463,13 @@
|
||||
if (userId.startsWith('grp_') || n.type?.startsWith('group.') || n.type === 'groupChange') {
|
||||
const groupId = userId.startsWith('grp_') ? userId : n.data?.groupId || n.details?.groupId || '';
|
||||
if (groupId) {
|
||||
groupStore.showGroupDialog(groupId);
|
||||
showGroupDialog(groupId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (userId) {
|
||||
userStore.showUserDialog(userId);
|
||||
showUserDialog(userId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,11 +66,12 @@
|
||||
import { useVrcxVueTable } from '../../../lib/table/useVrcxVueTable';
|
||||
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import { showUserDialog } from '../../../coordinators/userCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const { friends } = storeToRefs(useFriendStore());
|
||||
const { showUserDialog } = useUserStore();
|
||||
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
Reference in New Issue
Block a user