mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 14:26:06 +02:00
Fix clear and copy favorites
This commit is contained in:
+3
-47
@@ -1187,61 +1187,18 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* aka: `$app.methods.bulkCopyFavoriteSelection`
|
||||
* @param {'friend'|'world'|'avatar'} type
|
||||
*/
|
||||
function bulkCopyFavoriteSelection(type) {
|
||||
let idList = '';
|
||||
switch (type) {
|
||||
case 'friend':
|
||||
for (const ctx of state.favoriteFriends) {
|
||||
if (ctx.$selected) {
|
||||
idList += `${ctx.id}\n`;
|
||||
}
|
||||
}
|
||||
state.friendImportDialogInput = idList;
|
||||
showFriendImportDialog();
|
||||
break;
|
||||
|
||||
case 'world':
|
||||
for (const ctx of state.favoriteWorlds) {
|
||||
if (ctx.$selected) {
|
||||
idList += `${ctx.id}\n`;
|
||||
}
|
||||
}
|
||||
state.worldImportDialogInput = idList;
|
||||
showWorldImportDialog();
|
||||
break;
|
||||
|
||||
case 'avatar':
|
||||
for (const ctx of state.favoriteAvatars) {
|
||||
if (ctx.$selected) {
|
||||
idList += `${ctx.id}\n`;
|
||||
}
|
||||
}
|
||||
state.avatarImportDialogInput = idList;
|
||||
showAvatarImportDialog();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
console.log('Favorite selection\n', idList);
|
||||
}
|
||||
|
||||
/**
|
||||
* aka: `$app.methods.clearBulkFavoriteSelection`
|
||||
*/
|
||||
function clearBulkFavoriteSelection() {
|
||||
let ctx;
|
||||
for (ctx of state.favoriteFriends) {
|
||||
for (ctx of state.favoriteFriends_) {
|
||||
ctx.$selected = false;
|
||||
}
|
||||
for (ctx of state.favoriteWorlds) {
|
||||
for (ctx of state.favoriteWorlds_) {
|
||||
ctx.$selected = false;
|
||||
}
|
||||
for (ctx of state.favoriteAvatars) {
|
||||
for (ctx of state.favoriteAvatars_) {
|
||||
ctx.$selected = false;
|
||||
}
|
||||
}
|
||||
@@ -1967,7 +1924,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
showWorldImportDialog,
|
||||
showAvatarImportDialog,
|
||||
showFriendImportDialog,
|
||||
bulkCopyFavoriteSelection,
|
||||
getLocalWorldFavoriteGroupLength,
|
||||
addLocalWorldFavorite,
|
||||
hasLocalWorldFavorite,
|
||||
|
||||
Reference in New Issue
Block a user