mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 22:06:06 +02:00
Fix moving favorites
This commit is contained in:
@@ -83,14 +83,14 @@
|
||||
addFavoriteAvatar(groupAPI);
|
||||
}
|
||||
} else {
|
||||
moveFavorite(props.currentFavorite.ref, groupAPI, props.type);
|
||||
moveFavorite(props.currentFavorite.ref, groupAPI);
|
||||
}
|
||||
}
|
||||
|
||||
function moveFavorite(ref, group, type) {
|
||||
function moveFavorite(ref, group) {
|
||||
favoriteRequest.deleteFavorite({ objectId: ref.id }).then(() => {
|
||||
favoriteRequest.addFavorite({
|
||||
type,
|
||||
type: group.type,
|
||||
favoriteId: ref.id,
|
||||
tags: group.name
|
||||
});
|
||||
@@ -100,7 +100,7 @@
|
||||
function addFavoriteAvatar(groupAPI) {
|
||||
return favoriteRequest
|
||||
.addFavorite({
|
||||
type: 'avatar',
|
||||
type: groupAPI.type,
|
||||
favoriteId: props.currentFavorite.id,
|
||||
tags: groupAPI.name
|
||||
})
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
const { showUserDialog } = useUserStore();
|
||||
const { favoriteAvatarGroups, avatarImportDialogInput, avatarImportDialogVisible, localAvatarFavoriteGroups } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
const { addLocalAvatarFavorite, localAvatarFavGroupLength } = useFavoriteStore();
|
||||
const { addLocalAvatarFavorite, localAvatarFavGroupLength, getCachedFavoritesByObjectId } = useFavoriteStore();
|
||||
const { showAvatarDialog, applyAvatar } = useAvatarStore();
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
function addFavoriteAvatar(ref, group, message) {
|
||||
return favoriteRequest
|
||||
.addFavorite({
|
||||
type: 'avatar',
|
||||
type: group.type,
|
||||
favoriteId: ref.id,
|
||||
tags: group.name
|
||||
})
|
||||
@@ -329,6 +329,9 @@
|
||||
}
|
||||
ref = data[i];
|
||||
if (D.avatarImportFavoriteGroup) {
|
||||
if (getCachedFavoritesByObjectId(ref.id)) {
|
||||
throw new Error('Avatar is already in favorites');
|
||||
}
|
||||
await addFavoriteAvatar(ref, D.avatarImportFavoriteGroup, false);
|
||||
} else if (D.avatarImportLocalFavoriteGroup) {
|
||||
addLocalAvatarFavorite(ref.id, D.avatarImportLocalFavoriteGroup);
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
const { favoriteFriendGroups, friendImportDialogInput, friendImportDialogVisible } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
const { getCachedFavoritesByObjectId } = useFavoriteStore();
|
||||
|
||||
const friendImportDialog = ref({
|
||||
loading: false,
|
||||
@@ -234,6 +235,9 @@
|
||||
break;
|
||||
}
|
||||
ref = data[i];
|
||||
if (getCachedFavoritesByObjectId(ref.id)) {
|
||||
throw new Error('Friend is already in favorites');
|
||||
}
|
||||
await addFavoriteUser(ref, D.friendImportFavoriteGroup, false);
|
||||
removeFromArray(friendImportTable.value.data, ref);
|
||||
D.userIdList.delete(ref.id);
|
||||
@@ -250,7 +254,7 @@
|
||||
function addFavoriteUser(ref, group, message) {
|
||||
return favoriteRequest
|
||||
.addFavorite({
|
||||
type: 'friend',
|
||||
type: group.type,
|
||||
favoriteId: ref.id,
|
||||
tags: group.name
|
||||
})
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
const { showUserDialog } = useUserStore();
|
||||
const { favoriteWorldGroups, worldImportDialogInput, worldImportDialogVisible, localWorldFavoriteGroups } =
|
||||
storeToRefs(useFavoriteStore());
|
||||
const { localWorldFavGroupLength, addLocalWorldFavorite } = useFavoriteStore();
|
||||
const { localWorldFavGroupLength, addLocalWorldFavorite, getCachedFavoritesByObjectId } = useFavoriteStore();
|
||||
const { showWorldDialog } = useWorldStore();
|
||||
const { showFullscreenImageDialog } = useGalleryStore();
|
||||
|
||||
@@ -321,6 +321,9 @@
|
||||
}
|
||||
ref = data[i];
|
||||
if (D.worldImportFavoriteGroup) {
|
||||
if (getCachedFavoritesByObjectId(ref.id)) {
|
||||
throw new Error('World is already in favorites');
|
||||
}
|
||||
await addFavoriteWorld(ref, D.worldImportFavoriteGroup, false);
|
||||
} else if (D.worldImportLocalFavoriteGroup) {
|
||||
addLocalWorldFavorite(ref.id, D.worldImportLocalFavoriteGroup);
|
||||
|
||||
Reference in New Issue
Block a user