mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 13:53:52 +02:00
replace ElMessage with Sonner
This commit is contained in:
@@ -38,8 +38,8 @@
|
||||
<script setup>
|
||||
import { CopyDocument, Download, RefreshLeft, RefreshRight, ZoomIn, ZoomOut } from '@element-plus/icons-vue';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import Noty from 'noty';
|
||||
|
||||
@@ -92,10 +92,7 @@
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
const msg = ElMessage({
|
||||
message: 'Downloading image...',
|
||||
type: 'info'
|
||||
});
|
||||
const msg = toast.info('Downloading image...');
|
||||
try {
|
||||
const response = await webApiService.execute({
|
||||
url,
|
||||
@@ -109,10 +106,7 @@
|
||||
'image/png': await (await fetch(response.data)).blob()
|
||||
})
|
||||
]);
|
||||
ElMessage({
|
||||
message: 'Image copied to clipboard',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Image copied to clipboard');
|
||||
} catch (error) {
|
||||
console.error('Error downloading image:', error);
|
||||
new Noty({
|
||||
@@ -120,7 +114,7 @@
|
||||
text: escapeTag(`Failed to download image. ${url}`)
|
||||
}).show();
|
||||
} finally {
|
||||
msg.close();
|
||||
toast.dismiss(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,10 +122,7 @@
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
const msg = ElMessage({
|
||||
message: 'Downloading image...',
|
||||
type: 'info'
|
||||
});
|
||||
const msg = toast.info('Downloading image...');
|
||||
try {
|
||||
const response = await webApiService.execute({
|
||||
url,
|
||||
@@ -163,7 +154,7 @@
|
||||
text: escapeTag(`Failed to download image. ${url}`)
|
||||
}).show();
|
||||
} finally {
|
||||
msg.close();
|
||||
toast.dismiss(msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -63,9 +63,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { reactive, watch } from 'vue';
|
||||
import { CaretBottom } from '@element-plus/icons-vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useGroupStore, useInstanceStore, useLocationStore, useUserStore } from '../stores';
|
||||
@@ -132,7 +133,7 @@
|
||||
if (action !== 'confirm') return;
|
||||
const args = await miscRequest.closeInstance({ location, hardClose: false });
|
||||
if (args.json) {
|
||||
ElMessage({ message: t('message.instance.closed'), type: 'success' });
|
||||
toast.success(t('message.instance.closed'));
|
||||
instanceStore.applyInstance(args.json);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
<script setup>
|
||||
import { Loading, Message } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { computed } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { checkCanInviteSelf, parseLocation } from '../shared/utils';
|
||||
@@ -52,7 +52,7 @@
|
||||
shortName: props.shortname
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({ message: 'Self invite sent', type: 'success' });
|
||||
toast.success('Self invite sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -567,8 +567,9 @@
|
||||
Warning
|
||||
} from '@element-plus/icons-vue';
|
||||
import { computed, defineAsyncComponent, nextTick, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -787,10 +788,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Fallback avatar changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Fallback avatar changed');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -803,10 +801,7 @@
|
||||
.then((args) => {
|
||||
// 'AVATAR-MODERATION';
|
||||
applyAvatarModeration(args.json);
|
||||
ElMessage({
|
||||
message: 'Avatar blocked',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar blocked');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -835,10 +830,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
ElMessage({
|
||||
message: 'Avatar updated to public',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar updated to public');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -850,10 +842,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
ElMessage({
|
||||
message: 'Avatar updated to private',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar updated to private');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -876,10 +865,7 @@
|
||||
sortUserDialogAvatars(array);
|
||||
}
|
||||
|
||||
ElMessage({
|
||||
message: 'Avatar deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar deleted');
|
||||
D.visible = false;
|
||||
return args;
|
||||
});
|
||||
@@ -890,10 +876,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Imposter deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Imposter deleted');
|
||||
showAvatarDialog(D.id);
|
||||
return args;
|
||||
});
|
||||
@@ -904,10 +887,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Imposter queued for creation',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Imposter queued for creation');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -926,10 +906,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Imposter deleted and queued for creation',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Imposter deleted and queued for creation');
|
||||
return args;
|
||||
});
|
||||
});
|
||||
@@ -968,10 +945,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
ElMessage({
|
||||
message: t('prompt.change_avatar_description.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_avatar_description.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -996,10 +970,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
ElMessage({
|
||||
message: t('prompt.rename_avatar.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.rename_avatar.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -1130,10 +1101,7 @@
|
||||
avatarRequest
|
||||
.uploadAvatarGalleryImage(base64Body, avatarDialog.value.id)
|
||||
.then(async (args) => {
|
||||
ElMessage({
|
||||
message: t('message.avatar_gallery.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.avatar_gallery.uploaded'));
|
||||
console.log(args);
|
||||
avatarDialog.value.galleryImages = await getAvatarGallery(avatarDialog.value.id);
|
||||
return args;
|
||||
@@ -1163,24 +1131,15 @@
|
||||
});
|
||||
const index = fileIds.indexOf(fileId);
|
||||
if (index === -1) {
|
||||
ElMessage({
|
||||
message: t('message.avatar_gallery.not_found'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.avatar_gallery.not_found'));
|
||||
return;
|
||||
}
|
||||
if (direction === -1 && index === 0) {
|
||||
ElMessage({
|
||||
message: t('message.avatar_gallery.already_first'),
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(t('message.avatar_gallery.already_first'));
|
||||
return;
|
||||
}
|
||||
if (direction === 1 && index === fileIds.length - 1) {
|
||||
ElMessage({
|
||||
message: t('message.avatar_gallery.already_last'),
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(t('message.avatar_gallery.already_last'));
|
||||
return;
|
||||
}
|
||||
if (direction === -1) {
|
||||
@@ -1189,10 +1148,7 @@
|
||||
moveArrayItem(fileIds, index, index + 1);
|
||||
}
|
||||
avatarRequest.setAvatarGalleryOrder(fileIds).then(async (args) => {
|
||||
ElMessage({
|
||||
message: t('message.avatar_gallery.reordered'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.avatar_gallery.reordered'));
|
||||
avatarDialog.value.galleryImages = await getAvatarGallery(avatarDialog.value.id);
|
||||
return args;
|
||||
});
|
||||
@@ -1201,10 +1157,7 @@
|
||||
function deleteAvatarGalleryImage(imageUrl) {
|
||||
const fileId = extractFileId(imageUrl);
|
||||
miscRequest.deleteFile(fileId).then((args) => {
|
||||
ElMessage({
|
||||
message: t('message.avatar_gallery.deleted'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.avatar_gallery.deleted'));
|
||||
getAvatarGallery(avatarDialog.value.id);
|
||||
return args;
|
||||
});
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { avatarRequest, imageRequest } from '../../../api';
|
||||
@@ -286,10 +286,7 @@
|
||||
function avatarImageSet(args) {
|
||||
changeAvatarImageDialogLoading.value = false;
|
||||
if (args.json.imageUrl === args.params.imageUrl) {
|
||||
ElMessage({
|
||||
message: t('message.avatar.image_changed'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.avatar.image_changed'));
|
||||
emit('update:previousImageUrl', args.json.imageUrl);
|
||||
} else {
|
||||
$throw(0, 'avatar image change failed', args.params.imageUrl);
|
||||
@@ -308,10 +305,7 @@
|
||||
const ref = applyAvatar(avatarArgs.json);
|
||||
changeAvatarImageDialogLoading.value = false;
|
||||
emit('update:previousImageUrl', ref.imageUrl);
|
||||
ElMessage({
|
||||
message: t('message.avatar.image_changed'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.avatar.image_changed'));
|
||||
|
||||
// closeDialog();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { watch } from 'vue';
|
||||
|
||||
@@ -150,11 +150,11 @@
|
||||
.saveAvatar(params)
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
ElMessage({ message: t('dialog.set_avatar_styles.save_success'), type: 'success' });
|
||||
toast.success(t('dialog.set_avatar_styles.save_success'));
|
||||
closeSetAvatarStylesDialog();
|
||||
})
|
||||
.catch((error) => {
|
||||
ElMessage({ message: t('dialog.set_avatar_styles.save_failed'), type: 'error' });
|
||||
toast.error(t('dialog.set_avatar_styles.save_failed'));
|
||||
console.error('Error saving avatar styles:', error);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Loading } from '@element-plus/icons-vue';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { watch } from 'vue';
|
||||
|
||||
@@ -254,10 +254,7 @@
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: 'Error saving avatar tags',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Error saving avatar tags');
|
||||
} finally {
|
||||
D.loading = false;
|
||||
D.visible = false;
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
|
||||
<script setup>
|
||||
import { Close, Refresh, Upload } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useGalleryStore, useUserStore } from '../../../stores';
|
||||
@@ -98,18 +98,12 @@
|
||||
}
|
||||
if (files[0].size >= 100000000) {
|
||||
// 100MB
|
||||
ElMessage({
|
||||
message: t('message.file.too_large'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.file.too_large'));
|
||||
clearFile();
|
||||
return;
|
||||
}
|
||||
if (!files[0].type.match(/image.*/)) {
|
||||
ElMessage({
|
||||
message: t('message.file.not_image'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.file.not_image'));
|
||||
clearFile();
|
||||
return;
|
||||
}
|
||||
@@ -118,10 +112,7 @@
|
||||
const base64Body = btoa(r.result.toString());
|
||||
vrcPlusImageRequest.uploadGalleryImage(base64Body).then((args) => {
|
||||
handleGalleryImageAdd(args);
|
||||
ElMessage({
|
||||
message: t('message.gallery.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.gallery.uploaded'));
|
||||
if (Object.keys(galleryTable.value).length !== 0) {
|
||||
galleryTable.value.unshift(args.json);
|
||||
}
|
||||
|
||||
@@ -1155,8 +1155,9 @@
|
||||
Warning
|
||||
} from '@element-plus/icons-vue';
|
||||
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -1545,15 +1546,9 @@
|
||||
getGroupDialogGroup(id);
|
||||
}
|
||||
if (args.json.membershipStatus === 'member') {
|
||||
ElMessage({
|
||||
message: 'Group joined',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group joined');
|
||||
} else if (args.json.membershipStatus === 'requested') {
|
||||
ElMessage({
|
||||
message: 'Group join request sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group join request sent');
|
||||
}
|
||||
return args;
|
||||
});
|
||||
|
||||
@@ -864,8 +864,8 @@
|
||||
<script setup>
|
||||
import { ArrowDown, Delete, Loading, Refresh, Warning } from '@element-plus/icons-vue';
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { debounce, formatDateFilter, hasGroupPermission, userImage, userImageFull } from '../../../shared/utils';
|
||||
@@ -1080,18 +1080,12 @@
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to delete group invites: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to delete group invites: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Deleted ${memberCount} group invites`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Deleted ${memberCount} group invites`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1132,10 +1126,7 @@
|
||||
}
|
||||
groupBansModerationTable.data = fetchedBans;
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Failed to get group bans',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to get group bans');
|
||||
} finally {
|
||||
isGroupMembersLoading.value = false;
|
||||
}
|
||||
@@ -1163,13 +1154,10 @@
|
||||
await groupRequest.banGroupMember({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to ban group member: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to ban group member: ${err}`);
|
||||
}
|
||||
}
|
||||
ElMessage({ message: `Banned ${memberCount} group members`, type: 'success' });
|
||||
toast.success(`Banned ${memberCount} group members`);
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
getAllGroupBans(D.id);
|
||||
@@ -1192,16 +1180,13 @@
|
||||
await groupRequest.unbanGroupMember({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to unban group member: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to unban group member: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (allSuccess) {
|
||||
ElMessage({ message: `Unbanned ${memberCount} group members`, type: 'success' });
|
||||
toast.success(`Unbanned ${memberCount} group members`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1226,15 +1211,12 @@
|
||||
await groupRequest.kickGroupMember({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to kick group member: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to kick group member: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({ message: `Kicked ${memberCount} group members`, type: 'success' });
|
||||
toast.success(`Kicked ${memberCount} group members`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1262,15 +1244,12 @@
|
||||
handleGroupMemberProps(args);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to set group member note for ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to set group member note for ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({ message: `Saved notes for ${memberCount} group members`, type: 'success' });
|
||||
toast.success(`Saved notes for ${memberCount} group members`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1310,19 +1289,13 @@
|
||||
handleGroupMemberRoleChange(args);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to remove group member roles: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to remove group member roles: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Roles removed`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Roles removed`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1358,19 +1331,13 @@
|
||||
handleGroupMemberRoleChange(args);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to add group member roles: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to add group member roles: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Added group member roles`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Added group member roles`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1462,10 +1429,7 @@
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Failed to get group logs',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to get group logs');
|
||||
} finally {
|
||||
isGroupMembersLoading.value = false;
|
||||
}
|
||||
@@ -1492,18 +1456,12 @@
|
||||
await groupRequest.deleteBlockedGroupRequest({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to delete blocked group requests: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to delete blocked group requests: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Deleted ${memberCount} blocked group requests`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Deleted ${memberCount} blocked group requests`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1528,18 +1486,12 @@
|
||||
await groupRequest.blockGroupInviteRequest({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to block group join requests: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to block group join requests: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Blocked ${memberCount} group join requests`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Blocked ${memberCount} group join requests`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1565,18 +1517,12 @@
|
||||
await groupRequest.rejectGroupInviteRequest({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to reject group join requests: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to reject group join requests: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Rejected ${memberCount} group join requests`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Rejected ${memberCount} group join requests`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1601,18 +1547,12 @@
|
||||
await groupRequest.acceptGroupInviteRequest({ groupId: D.id, userId: user.userId });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Failed to accept group join requests: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to accept group join requests: ${err}`);
|
||||
allSuccess = false;
|
||||
}
|
||||
}
|
||||
if (allSuccess) {
|
||||
ElMessage({
|
||||
message: `Accepted ${memberCount} group join requests`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Accepted ${memberCount} group join requests`);
|
||||
}
|
||||
progressCurrent.value = 0;
|
||||
progressTotal.value = 0;
|
||||
@@ -1657,10 +1597,7 @@
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Failed to get group join requests',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to get group join requests');
|
||||
} finally {
|
||||
isGroupMembersLoading.value = false;
|
||||
}
|
||||
@@ -1690,10 +1627,7 @@
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Failed to get group join requests',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to get group join requests');
|
||||
} finally {
|
||||
isGroupMembersLoading.value = false;
|
||||
}
|
||||
@@ -1727,10 +1661,7 @@
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Failed to get group invites',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to get group invites');
|
||||
} finally {
|
||||
isGroupMembersLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { groupRequest, vrcPlusIconRequest } from '../../../api';
|
||||
@@ -160,10 +160,7 @@
|
||||
return;
|
||||
}
|
||||
if (!D.title || !D.text) {
|
||||
ElMessage({
|
||||
message: 'Title and text are required',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('Title and text are required');
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
@@ -180,20 +177,14 @@
|
||||
}
|
||||
groupRequest.editGroupPost(params).then((args) => {
|
||||
handleGroupPost(args);
|
||||
ElMessage({
|
||||
message: 'Group post edited',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group post edited');
|
||||
});
|
||||
D.visible = false;
|
||||
}
|
||||
function createGroupPost() {
|
||||
const D = groupPostEditDialog.value;
|
||||
if (!D.title || !D.text) {
|
||||
ElMessage({
|
||||
message: 'Title and text are required',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('Title and text are required');
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
@@ -210,10 +201,7 @@
|
||||
}
|
||||
groupRequest.createGroupPost(params).then((args) => {
|
||||
handleGroupPost(args);
|
||||
ElMessage({
|
||||
message: 'Group post created',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group post created');
|
||||
});
|
||||
D.visible = false;
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { instanceRequest, inviteMessagesRequest, notificationRequest } from '../../../api';
|
||||
@@ -84,13 +84,10 @@
|
||||
})
|
||||
.then((args) => {
|
||||
if (args.json[slot].message === I.messageSlot.message) {
|
||||
ElMessage({
|
||||
message: "VRChat API didn't update message, try again",
|
||||
type: 'error'
|
||||
});
|
||||
toast.error("VRChat API didn't update message, try again");
|
||||
throw new Error("VRChat API didn't update message, try again");
|
||||
} else {
|
||||
ElMessage('Invite message updated');
|
||||
toast('Invite message updated');
|
||||
}
|
||||
return args;
|
||||
});
|
||||
@@ -137,10 +134,7 @@
|
||||
} else {
|
||||
J.loading = false;
|
||||
J.visible = false;
|
||||
ElMessage({
|
||||
message: 'Invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite sent');
|
||||
}
|
||||
};
|
||||
inviteLoop();
|
||||
@@ -153,10 +147,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Invite photo message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite photo message sent');
|
||||
return args;
|
||||
});
|
||||
} else {
|
||||
@@ -166,10 +157,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Invite message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite message sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -183,10 +171,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Request invite photo message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Request invite photo message sent');
|
||||
return args;
|
||||
});
|
||||
} else {
|
||||
@@ -196,10 +181,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Request invite message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Request invite message sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -168,9 +168,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useFriendStore, useGalleryStore, useInviteStore, useUserStore } from '../../../stores';
|
||||
@@ -280,10 +281,7 @@
|
||||
} else {
|
||||
D.loading = false;
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite sent');
|
||||
}
|
||||
};
|
||||
inviteLoop();
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { instanceRequest, notificationRequest } from '../../../api';
|
||||
@@ -104,10 +104,7 @@
|
||||
} else {
|
||||
J.loading = false;
|
||||
J.visible = false;
|
||||
ElMessage({
|
||||
message: 'Invite message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite message sent');
|
||||
}
|
||||
};
|
||||
inviteLoop();
|
||||
@@ -121,10 +118,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Invite photo message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite photo message sent');
|
||||
return args;
|
||||
});
|
||||
} else {
|
||||
@@ -134,10 +128,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Invite message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite message sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -151,10 +142,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Request invite photo message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Request invite photo message sent');
|
||||
return args;
|
||||
});
|
||||
} else {
|
||||
@@ -164,10 +152,7 @@
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Request invite message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Request invite message sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -166,8 +166,9 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { hasGroupPermission, userImage, userStatusClass } from '../../shared/utils';
|
||||
@@ -244,10 +245,7 @@
|
||||
}
|
||||
// not allowed to invite
|
||||
inviteGroupDialog.value.groupId = '';
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: 'You are not allowed to invite to this group'
|
||||
});
|
||||
toast.error('You are not allowed to invite to this group');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -120,8 +120,9 @@
|
||||
<script setup>
|
||||
import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { CopyDocument, Warning } from '@element-plus/icons-vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useFriendStore, useGameStore, useInviteStore, useLaunchStore, useLocationStore } from '../../stores';
|
||||
@@ -273,10 +274,7 @@
|
||||
shortName
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Self invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Self invite sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -334,15 +332,9 @@
|
||||
async function copyInstanceMessage(input) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(input);
|
||||
ElMessage({
|
||||
message: 'Instance copied to clipboard',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Instance copied to clipboard');
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: 'Instance copied failed',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Instance copied failed');
|
||||
console.error(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,8 +479,8 @@
|
||||
|
||||
<script setup>
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -735,10 +735,7 @@
|
||||
worldId: L.worldId
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Self invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Self invite sent');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<script setup>
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { getFaviconUrl } from '../../../shared/utils';
|
||||
@@ -78,10 +78,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Bio updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Bio updated');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { userRequest } from '../../../api';
|
||||
@@ -53,10 +53,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Pronouns updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Pronouns updated');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useUserStore } from '../../../stores';
|
||||
@@ -108,10 +108,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Status updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Status updated');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -293,9 +293,7 @@
|
||||
style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>
|
||||
{{ t('dialog.user.info.join_count') }}
|
||||
<TooltipWrapper
|
||||
side="top"
|
||||
:content="t('dialog.user.info.accuracy_notice')">
|
||||
<TooltipWrapper side="top" :content="t('dialog.user.info.accuracy_notice')">
|
||||
<el-icon style="margin-left: 3px"><Warning /></el-icon>
|
||||
</TooltipWrapper>
|
||||
</div>
|
||||
@@ -333,9 +331,7 @@
|
||||
<div class="detail">
|
||||
<span class="name">
|
||||
{{ t('dialog.user.info.play_time') }}
|
||||
<TooltipWrapper
|
||||
side="top"
|
||||
:content="t('dialog.user.info.accuracy_notice')">
|
||||
<TooltipWrapper side="top" :content="t('dialog.user.info.accuracy_notice')">
|
||||
<el-icon style="margin-left: 3px"><Warning /></el-icon>
|
||||
</TooltipWrapper>
|
||||
</span>
|
||||
@@ -875,9 +871,7 @@
|
||||
{{ t('dialog.group.tags.unsubscribed') }}</span
|
||||
>
|
||||
</el-button> -->
|
||||
<TooltipWrapper
|
||||
side="right"
|
||||
:content="t('dialog.user.groups.leave_group_tooltip')">
|
||||
<TooltipWrapper side="right" :content="t('dialog.user.groups.leave_group_tooltip')">
|
||||
<el-button
|
||||
v-if="shiftHeld"
|
||||
size="small"
|
||||
@@ -1366,8 +1360,9 @@
|
||||
Warning
|
||||
} from '@element-plus/icons-vue';
|
||||
import { computed, defineAsyncComponent, nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -1756,10 +1751,7 @@
|
||||
|
||||
function handleBadgeUpdate(args) {
|
||||
if (args.json) {
|
||||
ElMessage({
|
||||
message: t('message.badge.updated'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.badge.updated'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1778,10 +1770,7 @@
|
||||
D.isHideAvatar = false;
|
||||
}
|
||||
} else {
|
||||
ElMessage({
|
||||
message: t('message.avatar.change_moderation_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.avatar.change_moderation_failed'));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1845,7 +1834,7 @@
|
||||
D.id
|
||||
)
|
||||
.then((args) => {
|
||||
ElMessage('Request invite sent');
|
||||
toast('Request invite sent');
|
||||
return args;
|
||||
});
|
||||
} else if (command === 'Invite Message') {
|
||||
@@ -1892,7 +1881,7 @@
|
||||
D.id
|
||||
)
|
||||
.then((_args) => {
|
||||
ElMessage('Invite sent');
|
||||
toast('Invite sent');
|
||||
return _args;
|
||||
});
|
||||
});
|
||||
@@ -1904,10 +1893,7 @@
|
||||
if (fallbackAvatar) {
|
||||
showAvatarDialog(fallbackAvatar);
|
||||
} else {
|
||||
ElMessage({
|
||||
message: 'No fallback avatar set',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('No fallback avatar set');
|
||||
}
|
||||
} else if (command === 'Previous Instances') {
|
||||
showPreviousInstancesUserDialog(D.ref);
|
||||
@@ -2021,10 +2007,7 @@
|
||||
} else if (ref.type === 'muteChat') {
|
||||
D.isMuteChat = true;
|
||||
}
|
||||
ElMessage({
|
||||
message: t('message.user.moderated'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.user.moderated'));
|
||||
}
|
||||
|
||||
async function performUserDialogCommand(command, userId) {
|
||||
@@ -2481,10 +2464,7 @@
|
||||
homeLocation: ''
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Home world has been reset',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Home world has been reset');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -2554,10 +2534,7 @@
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: 'Failed to save in-game group order',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to save in-game group order');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { imageRequest, worldRequest } from '../../../api';
|
||||
@@ -281,10 +281,7 @@
|
||||
function worldImageSet(args) {
|
||||
changeWorldImageDialogLoading.value = false;
|
||||
if (args.json.imageUrl === args.params.imageUrl) {
|
||||
ElMessage({
|
||||
message: t('message.world.image_changed'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.world.image_changed'));
|
||||
emit('update:previousImageUrl', args.json.imageUrl);
|
||||
} else {
|
||||
$throw(0, 'World image change failed', args.params.imageUrl);
|
||||
@@ -303,10 +300,7 @@
|
||||
const ref = applyWorld(worldArgs.json);
|
||||
changeWorldImageDialogLoading.value = false;
|
||||
emit('update:previousImageUrl', ref.imageUrl);
|
||||
ElMessage({
|
||||
message: t('message.world.image_changed'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.world.image_changed'));
|
||||
|
||||
// closeDialog();
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useWorldStore } from '../../../stores';
|
||||
@@ -306,10 +306,7 @@
|
||||
tags
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Tags updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Tags updated');
|
||||
emit('update:isSetWorldTagsDialogVisible', false);
|
||||
if (props.isWorldDialogVisible) {
|
||||
showWorldDialog(args.json.id);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { worldRequest } from '../../../api';
|
||||
@@ -76,10 +76,7 @@
|
||||
urlList: urlList.value
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Allowed Video Player Domains updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Allowed Video Player Domains updated');
|
||||
return args;
|
||||
});
|
||||
D.visible = false;
|
||||
|
||||
@@ -748,8 +748,9 @@
|
||||
Warning
|
||||
} from '@element-plus/icons-vue';
|
||||
import { computed, defineAsyncComponent, nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -983,10 +984,7 @@
|
||||
homeLocation: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Home world updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Home world updated');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -996,10 +994,7 @@
|
||||
homeLocation: ''
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Home world has been reset',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Home world has been reset');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1009,10 +1004,7 @@
|
||||
worldId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'World has been published',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World has been published');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1022,10 +1014,7 @@
|
||||
worldId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'World has been unpublished',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World has been unpublished');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1038,10 +1027,7 @@
|
||||
if (args.params.worldId === worldDialog.value.id && worldDialog.value.visible) {
|
||||
worldDialog.value.hasPersistData = false;
|
||||
}
|
||||
ElMessage({
|
||||
message: 'Persistent data has been deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Persistent data has been deleted');
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1063,10 +1049,7 @@
|
||||
const array = Array.from(map.values());
|
||||
userDialog.value.worlds = array;
|
||||
}
|
||||
ElMessage({
|
||||
message: 'World has been deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World has been deleted');
|
||||
D.visible = false;
|
||||
return args;
|
||||
});
|
||||
@@ -1141,10 +1124,7 @@
|
||||
name: value
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('prompt.rename_world.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.rename_world.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -1171,10 +1151,7 @@
|
||||
description: value
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('prompt.change_world_description.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_world_description.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -1199,10 +1176,7 @@
|
||||
capacity: Number(value)
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('prompt.change_world_capacity.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_world_capacity.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -1231,10 +1205,7 @@
|
||||
recommendedCapacity: Number(value)
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('prompt.change_world_recommended_capacity.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_world_recommended_capacity.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -1265,10 +1236,7 @@
|
||||
processedValue = id2;
|
||||
}
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: t('prompt.change_world_preview.message.error'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('prompt.change_world_preview.message.error'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1279,10 +1247,7 @@
|
||||
previewYoutubeId: processedValue
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('prompt.change_world_preview.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_world_preview.message.success'));
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -1318,51 +1283,33 @@
|
||||
navigator.clipboard
|
||||
.writeText(worldDialog.value.id)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'World ID copied to clipboard',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World ID copied to clipboard');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('copy failed:', err);
|
||||
ElMessage({
|
||||
message: 'Copy failed',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Copy failed');
|
||||
});
|
||||
}
|
||||
function copyWorldUrl() {
|
||||
navigator.clipboard
|
||||
.writeText(`https://vrchat.com/home/world/${worldDialog.value.id}`)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'World URL copied to clipboard',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World URL copied to clipboard');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('copy failed:', err);
|
||||
ElMessage({
|
||||
message: 'Copy failed',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Copy failed');
|
||||
});
|
||||
}
|
||||
function copyWorldName() {
|
||||
navigator.clipboard
|
||||
.writeText(worldDialog.value.ref.name)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'World name copied to clipboard',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World name copied to clipboard');
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('copy failed:', err);
|
||||
ElMessage({
|
||||
message: 'Copy failed',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Copy failed');
|
||||
});
|
||||
}
|
||||
function showWorldAllowedDomainsDialog() {
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="size in pageSizes" :key="size" :value="String(size)">
|
||||
<SelectItem v-for="size in pageSizes" :key="String(size)" :value="String(size)">
|
||||
{{ size }}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
@@ -81,7 +81,9 @@
|
||||
class="flex-none">
|
||||
<PaginationContent v-slot="{ items }">
|
||||
<PaginationPrevious />
|
||||
<template v-for="item in items" :key="item.key">
|
||||
<template
|
||||
v-for="(item, index) in items"
|
||||
:key="item.type === 'page' ? `page-${item.value}` : `ellipsis-${index}`">
|
||||
<PaginationItem
|
||||
v-if="item.type === 'page'"
|
||||
:value="item.value"
|
||||
|
||||
62
src/components/ui/sonner/Sonner.vue
Normal file
62
src/components/ui/sonner/Sonner.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<script setup>
|
||||
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from 'lucide-vue-next';
|
||||
import { Toaster as Sonner } from 'vue-sonner';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const props = defineProps({
|
||||
id: { type: String, required: false },
|
||||
invert: { type: Boolean, required: false },
|
||||
theme: { type: String, required: false },
|
||||
position: { type: String, required: false },
|
||||
closeButtonPosition: { type: String, required: false },
|
||||
hotkey: { type: Array, required: false },
|
||||
richColors: { type: Boolean, required: false },
|
||||
expand: { type: Boolean, required: false },
|
||||
duration: { type: Number, required: false },
|
||||
gap: { type: Number, required: false },
|
||||
visibleToasts: { type: Number, required: false },
|
||||
closeButton: { type: Boolean, required: false },
|
||||
toastOptions: { type: Object, required: false },
|
||||
class: { type: String, required: false },
|
||||
style: { type: Object, required: false },
|
||||
offset: { type: [Object, String, Number], required: false },
|
||||
mobileOffset: { type: [Object, String, Number], required: false },
|
||||
dir: { type: String, required: false },
|
||||
swipeDirections: { type: Array, required: false },
|
||||
icons: { type: Object, required: false },
|
||||
containerAriaLabel: { type: String, required: false }
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Sonner
|
||||
:class="cn('toaster group', props.class)"
|
||||
:style="{
|
||||
'--normal-bg': 'var(--popover)',
|
||||
'--normal-text': 'var(--popover-foreground)',
|
||||
'--normal-border': 'var(--border)',
|
||||
'--border-radius': 'var(--radius)'
|
||||
}"
|
||||
v-bind="props">
|
||||
<template #success-icon>
|
||||
<CircleCheckIcon class="size-4" />
|
||||
</template>
|
||||
<template #info-icon>
|
||||
<InfoIcon class="size-4" />
|
||||
</template>
|
||||
<template #warning-icon>
|
||||
<TriangleAlertIcon class="size-4" />
|
||||
</template>
|
||||
<template #error-icon>
|
||||
<OctagonXIcon class="size-4" />
|
||||
</template>
|
||||
<template #loading-icon>
|
||||
<div>
|
||||
<Loader2Icon class="size-4 animate-spin" />
|
||||
</div>
|
||||
</template>
|
||||
<template #close-icon>
|
||||
<XIcon class="size-4" />
|
||||
</template>
|
||||
</Sonner>
|
||||
</template>
|
||||
1
src/components/ui/sonner/index.js
Normal file
1
src/components/ui/sonner/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export { default as Toaster } from './Sonner.vue';
|
||||
Reference in New Issue
Block a user