mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 22:36:05 +02:00
use computed get local favorite group length
This commit is contained in:
+18
-28
@@ -135,6 +135,22 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
return groupedByGroupKeyFavoriteFriends;
|
||||
});
|
||||
|
||||
const localWorldFavGroupLength = computed(() => (group) => {
|
||||
const favoriteGroup = localWorldFavorites.value[group];
|
||||
if (!favoriteGroup) {
|
||||
return 0;
|
||||
}
|
||||
return favoriteGroup.length;
|
||||
});
|
||||
|
||||
const localAvatarFavGroupLength = computed(() => (group) => {
|
||||
const favoriteGroup = localAvatarFavorites.value[group];
|
||||
if (!favoriteGroup) {
|
||||
return 0;
|
||||
}
|
||||
return favoriteGroup.length;
|
||||
});
|
||||
|
||||
watch(
|
||||
() => watchState.isLoggedIn,
|
||||
(isLoggedIn) => {
|
||||
@@ -905,19 +921,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
friendImportDialogVisible.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} group
|
||||
* @returns {*|number}
|
||||
*/
|
||||
function getLocalWorldFavoriteGroupLength(group) {
|
||||
const favoriteGroup = localWorldFavorites.value[group];
|
||||
if (!favoriteGroup) {
|
||||
return 0;
|
||||
}
|
||||
return favoriteGroup.length;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} worldId
|
||||
@@ -1040,19 +1043,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} group
|
||||
* @returns {*|number}
|
||||
*/
|
||||
function getLocalAvatarFavoriteGroupLength(group) {
|
||||
const favoriteGroup = localAvatarFavorites.value[group];
|
||||
if (!favoriteGroup) {
|
||||
return 0;
|
||||
}
|
||||
return favoriteGroup.length;
|
||||
}
|
||||
|
||||
function updateFavoriteDialog(objectId) {
|
||||
const D = favoriteDialog.value;
|
||||
if (!D.visible || D.objectId !== objectId) {
|
||||
@@ -1608,12 +1598,12 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
showWorldImportDialog,
|
||||
showAvatarImportDialog,
|
||||
showFriendImportDialog,
|
||||
getLocalWorldFavoriteGroupLength,
|
||||
localWorldFavGroupLength,
|
||||
addLocalWorldFavorite,
|
||||
hasLocalWorldFavorite,
|
||||
hasLocalAvatarFavorite,
|
||||
addLocalAvatarFavorite,
|
||||
getLocalAvatarFavoriteGroupLength,
|
||||
localAvatarFavGroupLength,
|
||||
updateFavoriteDialog,
|
||||
deleteLocalAvatarFavoriteGroup,
|
||||
renameLocalAvatarFavoriteGroup,
|
||||
|
||||
Reference in New Issue
Block a user