mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 22:06:06 +02:00
cleanup
This commit is contained in:
@@ -187,6 +187,20 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
database.clearAvatarHistory();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array} value
|
||||
*/
|
||||
function setAvatarHistory(value) {
|
||||
avatarHistory.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} value
|
||||
*/
|
||||
function setLoadingToastId(value) {
|
||||
loadingToastId.value = value;
|
||||
}
|
||||
|
||||
return {
|
||||
avatarDialog,
|
||||
avatarHistory,
|
||||
@@ -200,6 +214,8 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
getAvatarGallery,
|
||||
updateVRChatAvatarCache,
|
||||
clearAvatarHistory,
|
||||
setAvatarHistory,
|
||||
setLoadingToastId,
|
||||
setAvatarDialogVisible,
|
||||
setAvatarDialogIsFavorite,
|
||||
setAvatarDialogLoading
|
||||
|
||||
+25
-4
@@ -6,7 +6,6 @@ import { useI18n } from 'vue-i18n';
|
||||
import {
|
||||
compareByName,
|
||||
createDefaultFavoriteGroupRef,
|
||||
removeFromArray,
|
||||
replaceReactiveObject
|
||||
} from '../shared/utils';
|
||||
import { favoriteRequest } from '../api';
|
||||
@@ -16,8 +15,6 @@ import { useAppearanceSettingsStore } from './settings/appearance';
|
||||
import { watchState } from '../services/watchState';
|
||||
import { onLoginStateChanged } from '../coordinators/favoriteCoordinator';
|
||||
|
||||
import configRepository from '../services/config';
|
||||
|
||||
export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
const appearanceSettingsStore = useAppearanceSettingsStore();
|
||||
|
||||
@@ -736,6 +733,27 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
return indexA - indexB;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
*/
|
||||
function setIsFavoriteLoading(value) {
|
||||
isFavoriteLoading.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} value
|
||||
*/
|
||||
function setFavoriteLimits(value) {
|
||||
favoriteLimits.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array} value
|
||||
*/
|
||||
function setFavoritesSortOrder(value) {
|
||||
favoritesSortOrder.value = value;
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
|
||||
@@ -799,6 +817,9 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
hasLocalFriendFavorite,
|
||||
isInAnyLocalFriendGroup,
|
||||
newLocalFriendFavoriteGroup,
|
||||
countFavoriteGroups
|
||||
countFavoriteGroups,
|
||||
setIsFavoriteLoading,
|
||||
setFavoriteLimits,
|
||||
setFavoritesSortOrder
|
||||
};
|
||||
});
|
||||
|
||||
+10
-6
@@ -12,10 +12,7 @@ import {
|
||||
} from '../shared/utils';
|
||||
import { getUserMemo } from '../coordinators/memoCoordinator';
|
||||
import { friendRequest, userRequest } from '../api';
|
||||
import {
|
||||
runInitFriendsListFlow,
|
||||
runRefreshFriendsListFlow
|
||||
} from '../coordinators/friendSyncCoordinator';
|
||||
import { runInitFriendsListFlow } from '../coordinators/friendSyncCoordinator';
|
||||
import {
|
||||
runPendingOfflineTickFlow,
|
||||
runUpdateFriendFlow
|
||||
@@ -45,7 +42,6 @@ export const useFriendStore = defineStore('Friend', () => {
|
||||
const userStore = useUserStore();
|
||||
const groupStore = useGroupStore();
|
||||
const locationStore = useLocationStore();
|
||||
const favoriteStore = useFavoriteStore();
|
||||
|
||||
const router = useRouter();
|
||||
const t = i18n.global.t;
|
||||
@@ -1134,6 +1130,13 @@ export const useFriendStore = defineStore('Friend', () => {
|
||||
friendLog.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
*/
|
||||
function setIsRefreshFriendsLoading(value) {
|
||||
isRefreshFriendsLoading.value = value;
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
|
||||
@@ -1169,6 +1172,7 @@ export const useFriendStore = defineStore('Friend', () => {
|
||||
getFriendLog,
|
||||
tryApplyFriendOrder,
|
||||
resetFriendLog,
|
||||
initFriendLogHistoryTable
|
||||
initFriendLogHistoryTable,
|
||||
setIsRefreshFriendsLoading
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,8 +31,6 @@ export const useGameStore = defineStore('Game', () => {
|
||||
|
||||
init();
|
||||
|
||||
// --- Atomic setters ---
|
||||
|
||||
/**
|
||||
* @param {boolean} value Game running flag.
|
||||
*/
|
||||
@@ -68,8 +66,6 @@ export const useGameStore = defineStore('Game', () => {
|
||||
state.lastCrashedTime = value;
|
||||
}
|
||||
|
||||
// --- Self-contained operations (no cross-store deps) ---
|
||||
|
||||
/**
|
||||
* Fetches VRChat cache size from AssetBundleManager.
|
||||
*/
|
||||
|
||||
+17
-11
@@ -2,8 +2,6 @@ import { reactive, ref, shallowRef, watch } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
compareGameLogRows,
|
||||
findUserByDisplayName,
|
||||
@@ -16,11 +14,7 @@ import { database } from '../../services/database';
|
||||
import { tryLoadPlayerList } from '../../coordinators/gameLogCoordinator';
|
||||
import { useAdvancedSettingsStore } from '../settings/advanced';
|
||||
import { useFriendStore } from '../friend';
|
||||
import { useGameStore } from '../game';
|
||||
import { useInstanceStore } from '../instance';
|
||||
import { useLocationStore } from '../location';
|
||||
import { useNotificationStore } from '../notification';
|
||||
import { useSharedFeedStore } from '../sharedFeed';
|
||||
import { useUiStore } from '../ui';
|
||||
import { useUserStore } from '../user';
|
||||
import { useVrStore } from '../vr';
|
||||
@@ -34,15 +28,11 @@ import * as workerTimers from 'worker-timers';
|
||||
export const useGameLogStore = defineStore('GameLog', () => {
|
||||
const notificationStore = useNotificationStore();
|
||||
const vrStore = useVrStore();
|
||||
const locationStore = useLocationStore();
|
||||
const friendStore = useFriendStore();
|
||||
const instanceStore = useInstanceStore();
|
||||
const userStore = useUserStore();
|
||||
const uiStore = useUiStore();
|
||||
const vrcxStore = useVrcxStore();
|
||||
const advancedSettingsStore = useAdvancedSettingsStore();
|
||||
const gameStore = useGameStore();
|
||||
const sharedFeedStore = useSharedFeedStore();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -449,6 +439,20 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
||||
gameLogTable.value.loading = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
*/
|
||||
function setLastVideoUrl(value) {
|
||||
lastVideoUrl.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
*/
|
||||
function setLastResourceloadUrl(value) {
|
||||
lastResourceloadUrl.value = value;
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
|
||||
@@ -472,6 +476,8 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
||||
addGameLogVRDancing,
|
||||
addGameLogZuwaZuwaDance,
|
||||
addGameLogLSMedia,
|
||||
addGameLogPopcornPalace
|
||||
addGameLogPopcornPalace,
|
||||
setLastVideoUrl,
|
||||
setLastResourceloadUrl
|
||||
};
|
||||
});
|
||||
|
||||
+25
-2
@@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { hasGroupPermission, replaceBioSymbols } from '../shared/utils';
|
||||
import { groupRequest, queryRequest } from '../api';
|
||||
import { groupDialogFilterOptions } from '../shared/constants/';
|
||||
import { watchState } from '../services/watchState';
|
||||
|
||||
export const useGroupStore = defineStore('Group', () => {
|
||||
@@ -288,6 +287,27 @@ export const useGroupStore = defineStore('Group', () => {
|
||||
D.visible = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
*/
|
||||
function setCurrentUserGroupsInit(value) {
|
||||
currentUserGroupsInit.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array} value
|
||||
*/
|
||||
function setInGameGroupOrder(value) {
|
||||
inGameGroupOrder.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array} value
|
||||
*/
|
||||
function setGroupInstances(value) {
|
||||
groupInstances.value = value;
|
||||
}
|
||||
|
||||
return {
|
||||
groupDialog,
|
||||
currentUserGroups,
|
||||
@@ -306,6 +326,9 @@ export const useGroupStore = defineStore('Group', () => {
|
||||
clearGroupInstances,
|
||||
setGroupDialogVisible,
|
||||
showModerateGroupDialog,
|
||||
showGroupMemberModerationDialog
|
||||
showGroupMemberModerationDialog,
|
||||
setCurrentUserGroupsInit,
|
||||
setInGameGroupOrder,
|
||||
setGroupInstances
|
||||
};
|
||||
});
|
||||
|
||||
@@ -75,7 +75,6 @@ export const useNotificationStore = defineStore('Notification', () => {
|
||||
const sharedFeedStore = useSharedFeedStore();
|
||||
const instanceStore = useInstanceStore();
|
||||
const modalStore = useModalStore();
|
||||
const groupStore = useGroupStore();
|
||||
|
||||
const notificationInitStatus = ref(false);
|
||||
const notificationTable = ref({
|
||||
|
||||
@@ -9,9 +9,7 @@ import { instanceRequest, userRequest } from '../api';
|
||||
import { groupRequest } from '../api/';
|
||||
import removeConfusables, { removeWhitespace } from '../services/confusables';
|
||||
import { useAppearanceSettingsStore } from './settings/appearance';
|
||||
import { useAvatarStore } from './avatar';
|
||||
import { useFriendStore } from './friend';
|
||||
import { useGroupStore } from './group';
|
||||
import { showGroupDialog } from '../coordinators/groupCoordinator';
|
||||
import { showWorldDialog } from '../coordinators/worldCoordinator';
|
||||
import { showAvatarDialog } from '../coordinators/avatarCoordinator';
|
||||
@@ -22,7 +20,6 @@ import {
|
||||
} from '../coordinators/userCoordinator';
|
||||
import { useModalStore } from './modal';
|
||||
import { useUserStore } from './user';
|
||||
import { useWorldStore } from './world';
|
||||
import { watchState } from '../services/watchState';
|
||||
|
||||
export const useSearchStore = defineStore('Search', () => {
|
||||
@@ -30,9 +27,6 @@ export const useSearchStore = defineStore('Search', () => {
|
||||
const router = useRouter();
|
||||
const appearanceSettingsStore = useAppearanceSettingsStore();
|
||||
const friendStore = useFriendStore();
|
||||
const worldStore = useWorldStore();
|
||||
const avatarStore = useAvatarStore();
|
||||
const groupStore = useGroupStore();
|
||||
const modalStore = useModalStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
|
||||
@@ -22,10 +22,6 @@ import { useWorldStore } from './world';
|
||||
|
||||
export const useUiStore = defineStore('Ui', () => {
|
||||
const notificationStore = useNotificationStore();
|
||||
const userStore = useUserStore();
|
||||
const worldStore = useWorldStore();
|
||||
const avatarStore = useAvatarStore();
|
||||
const groupStore = useGroupStore();
|
||||
const instanceStore = useInstanceStore();
|
||||
const router = useRouter();
|
||||
const keys = useMagicKeys();
|
||||
|
||||
@@ -11,14 +11,11 @@ import { clearVRCXCache } from '../coordinators/vrcxCoordinator';
|
||||
import { useAuthStore } from './auth';
|
||||
import { useDiscordPresenceSettingsStore } from './settings/discordPresence';
|
||||
import { useFriendStore } from './friend';
|
||||
import { useGameStore } from './game';
|
||||
import { useGroupStore } from './group';
|
||||
import { handleGroupUserInstances } from '../coordinators/groupCoordinator';
|
||||
import {
|
||||
getCurrentUser,
|
||||
updateAutoStateChange
|
||||
} from '../coordinators/userCoordinator';
|
||||
import { useModerationStore } from './moderation';
|
||||
import { useUserStore } from './user';
|
||||
import { useVRCXUpdaterStore } from './vrcxUpdater';
|
||||
import { useVrStore } from './vr';
|
||||
@@ -31,12 +28,9 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
|
||||
const authStore = useAuthStore();
|
||||
const userStore = useUserStore();
|
||||
const friendStore = useFriendStore();
|
||||
const gameStore = useGameStore();
|
||||
const moderationStore = useModerationStore();
|
||||
const vrcxStore = useVrcxStore();
|
||||
const discordPresenceSettingsStore = useDiscordPresenceSettingsStore();
|
||||
const vrcxUpdaterStore = useVRCXUpdaterStore();
|
||||
const groupStore = useGroupStore();
|
||||
const vrStore = useVrStore();
|
||||
const state = {
|
||||
nextCurrentUserRefresh: 300,
|
||||
@@ -152,7 +146,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
friendStore.isRefreshFriendsLoading = false;
|
||||
friendStore.setIsRefreshFriendsLoading(false);
|
||||
console.error(err);
|
||||
}
|
||||
workerTimers.setTimeout(() => updateLoop(), 1000);
|
||||
|
||||
+25
-3
@@ -12,13 +12,12 @@ import {
|
||||
parseLocation,
|
||||
replaceBioSymbols
|
||||
} from '../shared/utils';
|
||||
import { getAllUserMemos, getUserMemo } from '../coordinators/memoCoordinator';
|
||||
import { getAllUserMemos } from '../coordinators/memoCoordinator';
|
||||
import { instanceRequest, userRequest } from '../api';
|
||||
import { AppDebug } from '../services/appConfig';
|
||||
import { database } from '../services/database';
|
||||
import { runUpdateCurrentUserLocationFlow } from '../coordinators/locationCoordinator';
|
||||
import { useAppearanceSettingsStore } from './settings/appearance';
|
||||
import { useFavoriteStore } from './favorite';
|
||||
import { useFriendStore } from './friend';
|
||||
import { useInstanceStore } from './instance';
|
||||
import { useLocationStore } from './location';
|
||||
@@ -30,7 +29,6 @@ import * as workerTimers from 'worker-timers';
|
||||
export const useUserStore = defineStore('User', () => {
|
||||
const appearanceSettingsStore = useAppearanceSettingsStore();
|
||||
const friendStore = useFriendStore();
|
||||
const favoriteStore = useFavoriteStore();
|
||||
const locationStore = useLocationStore();
|
||||
const instanceStore = useInstanceStore();
|
||||
const uiStore = useUiStore();
|
||||
@@ -657,6 +655,27 @@ export const useUserStore = defineStore('User', () => {
|
||||
currentUser.value.$travelingToTime = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} value
|
||||
*/
|
||||
function setCurrentUser(value) {
|
||||
currentUser.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} value
|
||||
*/
|
||||
function setSubsetOfLanguages(value) {
|
||||
subsetOfLanguages.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array} value
|
||||
*/
|
||||
function setLanguageDialogLanguages(value) {
|
||||
languageDialog.value.languages = value;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
function markCurrentUserGameStarted() {
|
||||
@@ -715,6 +734,9 @@ export const useUserStore = defineStore('User', () => {
|
||||
setCurrentUserColour,
|
||||
setCurrentUserLocationState,
|
||||
setCurrentUserTravelingToTime,
|
||||
setCurrentUser,
|
||||
setSubsetOfLanguages,
|
||||
setLanguageDialogLanguages,
|
||||
markCurrentUserGameStarted,
|
||||
markCurrentUserGameStopped,
|
||||
checkNote,
|
||||
|
||||
+7
-21
@@ -17,21 +17,16 @@ import {
|
||||
import { debounce, parseLocation } from '../shared/utils';
|
||||
import { AppDebug } from '../services/appConfig';
|
||||
import { database } from '../services/database';
|
||||
import { failedGetRequests } from '../services/request';
|
||||
import { refreshCustomScript } from '../shared/utils/base/ui';
|
||||
import { useAdvancedSettingsStore } from './settings/advanced';
|
||||
import { useAvatarProviderStore } from './avatarProvider';
|
||||
import { useAvatarStore } from './avatar';
|
||||
import {
|
||||
addLocalWorldFavorite,
|
||||
addLocalAvatarFavorite
|
||||
} from '../coordinators/favoriteCoordinator';
|
||||
import { useFavoriteStore } from './favorite';
|
||||
import { useFriendStore } from './friend';
|
||||
import { useGalleryStore } from './gallery';
|
||||
import { useGameLogStore } from './gameLog';
|
||||
import { useGameStore } from './game';
|
||||
import { useGroupStore } from './group';
|
||||
import { showGroupDialog } from '../coordinators/groupCoordinator';
|
||||
import { showWorldDialog } from '../coordinators/worldCoordinator';
|
||||
import {
|
||||
@@ -40,7 +35,6 @@ import {
|
||||
selectAvatarWithoutConfirmation
|
||||
} from '../coordinators/avatarCoordinator';
|
||||
import { showUserDialog, addCustomTag } from '../coordinators/userCoordinator';
|
||||
import { useInstanceStore } from './instance';
|
||||
import { useLocationStore } from './location';
|
||||
import { useModalStore } from './modal';
|
||||
import { useNotificationStore } from './notification';
|
||||
@@ -49,7 +43,6 @@ import { useSearchStore } from './search';
|
||||
import { useUpdateLoopStore } from './updateLoop';
|
||||
import { useUserStore } from './user';
|
||||
import { useVrcStatusStore } from './vrcStatus';
|
||||
import { useWorldStore } from './world';
|
||||
import { clearVRCXCache } from '../coordinators/vrcxCoordinator';
|
||||
import { watchState } from '../services/watchState';
|
||||
|
||||
@@ -59,12 +52,8 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
const gameStore = useGameStore();
|
||||
const locationStore = useLocationStore();
|
||||
const notificationStore = useNotificationStore();
|
||||
const avatarStore = useAvatarStore();
|
||||
const worldStore = useWorldStore();
|
||||
const instanceStore = useInstanceStore();
|
||||
const friendStore = useFriendStore();
|
||||
|
||||
const favoriteStore = useFavoriteStore();
|
||||
const groupStore = useGroupStore();
|
||||
const userStore = useUserStore();
|
||||
const photonStore = usePhotonStore();
|
||||
const advancedSettingsStore = useAdvancedSettingsStore();
|
||||
@@ -73,7 +62,6 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
const gameLogStore = useGameLogStore();
|
||||
const updateLoopStore = useUpdateLoopStore();
|
||||
const vrcStatusStore = useVrcStatusStore();
|
||||
const galleryStore = useGalleryStore();
|
||||
const { t } = useI18n();
|
||||
const modalStore = useModalStore();
|
||||
|
||||
@@ -279,10 +267,6 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
searchLimit.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data
|
||||
@@ -644,10 +628,12 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
toast.error('Invalid local favorite world command');
|
||||
break;
|
||||
}
|
||||
queryRequest.fetch('world.location', { worldId: id }).then(() => {
|
||||
searchStore.directAccessWorld(id);
|
||||
addLocalWorldFavorite(id, group);
|
||||
});
|
||||
queryRequest
|
||||
.fetch('world.location', { worldId: id })
|
||||
.then(() => {
|
||||
searchStore.directAccessWorld(id);
|
||||
addLocalWorldFavorite(id, group);
|
||||
});
|
||||
break;
|
||||
case 'local-favorite-avatar':
|
||||
console.log('local-favorite-avatar', commandArg);
|
||||
|
||||
Reference in New Issue
Block a user