mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-27 10:43:48 +02:00
replace ElMessage with Sonner
This commit is contained in:
@@ -527,8 +527,9 @@
|
||||
<script setup>
|
||||
import { ArrowLeft, Close, Delete, Link, Picture, Plus, Present, Refresh, Upload } from '@element-plus/icons-vue';
|
||||
import { computed, onBeforeUnmount, onMounted, ref } 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 { useRouter } from 'vue-router';
|
||||
|
||||
@@ -636,10 +637,7 @@
|
||||
.uploadGalleryImage(base64Body)
|
||||
.then((args) => {
|
||||
handleGalleryImageAdd(args);
|
||||
ElMessage({
|
||||
message: t('message.gallery.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.gallery.uploaded'));
|
||||
return args;
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -667,10 +665,7 @@
|
||||
|
||||
function setProfilePicOverride(fileId) {
|
||||
if (!isLocalUserVrcPlusSupporter.value) {
|
||||
ElMessage({
|
||||
message: 'VRCPlus required',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('VRCPlus required');
|
||||
return;
|
||||
}
|
||||
let profilePicOverride = '';
|
||||
@@ -685,10 +680,7 @@
|
||||
profilePicOverride
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Profile picture changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Profile picture changed');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -739,10 +731,7 @@
|
||||
if (Object.keys(VRCPlusIconsTable.value).length !== 0) {
|
||||
VRCPlusIconsTable.value.unshift(args.json);
|
||||
}
|
||||
ElMessage({
|
||||
message: t('message.icon.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.icon.uploaded'));
|
||||
return args;
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -770,10 +759,7 @@
|
||||
|
||||
function setVRCPlusIcon(fileId) {
|
||||
if (!isLocalUserVrcPlusSupporter.value) {
|
||||
ElMessage({
|
||||
message: 'VRCPlus required',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('VRCPlus required');
|
||||
return;
|
||||
}
|
||||
let userIcon = '';
|
||||
@@ -788,10 +774,7 @@
|
||||
userIcon
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Icon changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Icon changed');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -878,10 +861,7 @@
|
||||
if (Object.keys(emojiTable.value).length !== 0) {
|
||||
emojiTable.value.unshift(args.json);
|
||||
}
|
||||
ElMessage({
|
||||
message: t('message.emoji.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.emoji.uploaded'));
|
||||
return args;
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -946,10 +926,7 @@
|
||||
.uploadSticker(base64Body, params)
|
||||
.then((args) => {
|
||||
handleStickerAdd(args);
|
||||
ElMessage({
|
||||
message: t('message.sticker.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.sticker.uploaded'));
|
||||
return args;
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -1020,10 +997,7 @@
|
||||
vrcPlusImageRequest
|
||||
.uploadPrint(base64Body, cropWhiteBorder, params)
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('message.print.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.print.uploaded'));
|
||||
if (Object.keys(printTable.value).length !== 0) {
|
||||
printTable.value.unshift(args.json);
|
||||
}
|
||||
@@ -1102,10 +1076,7 @@
|
||||
code: value.trim()
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: t('prompt.redeem.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.redeem.success'));
|
||||
getInventory();
|
||||
return args;
|
||||
})
|
||||
|
||||
@@ -208,8 +208,8 @@
|
||||
<script setup>
|
||||
import { computed, defineAsyncComponent, ref } from 'vue';
|
||||
import { ArrowRight } 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 { useRoute } from 'vue-router';
|
||||
|
||||
@@ -281,15 +281,9 @@
|
||||
function openVrcPhotosFolder() {
|
||||
AppApi.OpenVrcPhotosFolder().then((result) => {
|
||||
if (result) {
|
||||
ElMessage({
|
||||
message: 'Folder opened',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Folder opened');
|
||||
} else {
|
||||
ElMessage({
|
||||
message: "Folder dosn't exist",
|
||||
type: 'error'
|
||||
});
|
||||
toast.error("Folder dosn't exist");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -297,15 +291,9 @@
|
||||
function openVrcScreenshotsFolder() {
|
||||
AppApi.OpenVrcScreenshotsFolder().then((result) => {
|
||||
if (result) {
|
||||
ElMessage({
|
||||
message: 'Folder opened',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Folder opened');
|
||||
} else {
|
||||
ElMessage({
|
||||
message: "Folder dosn't exist",
|
||||
type: 'error'
|
||||
});
|
||||
toast.error("Folder dosn't exist");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
|
||||
<script setup>
|
||||
import { Calendar, Download, Star, StarFilled } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { computed } from 'vue';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useGalleryStore, useGroupStore } from '../../../stores';
|
||||
@@ -148,10 +148,7 @@
|
||||
}
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: `Failed to download .ics file, ${error.message}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to download .ics file, ${error.message}`);
|
||||
console.error('Failed to download .ics file:', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { inviteMessagesRequest } from '../../../api';
|
||||
@@ -69,13 +69,10 @@
|
||||
})
|
||||
.then((args) => {
|
||||
if (args.json[slot].message === props.inviteMessage.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({ message: 'Invite message updated', type: 'success' });
|
||||
toast.success('Invite message updated');
|
||||
emit('updateInviteMessages', messageType);
|
||||
}
|
||||
return args;
|
||||
|
||||
@@ -119,8 +119,8 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useInviteStore } from '../../../stores';
|
||||
@@ -173,10 +173,7 @@
|
||||
cooldownEnd.setHours(cooldownEnd.getHours() + 1);
|
||||
const now = new Date();
|
||||
if (now < cooldownEnd) {
|
||||
ElMessage({
|
||||
message: 'This invite message is on cooldown and cannot be edited yet.',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('This invite message is on cooldown and cannot be edited yet.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@
|
||||
<script setup>
|
||||
import { CopyDocument, Delete, Folder, FolderOpened, Picture, Upload } 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 { useGalleryStore, useUserStore, useVrcxStore } from '../../../stores';
|
||||
@@ -275,10 +275,7 @@
|
||||
return;
|
||||
}
|
||||
AppApi.CopyImageToClipboard(path).then(() => {
|
||||
ElMessage({
|
||||
message: 'Image copied to clipboard',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Image copied to clipboard');
|
||||
});
|
||||
}
|
||||
function openImageFolder(path) {
|
||||
@@ -286,10 +283,7 @@
|
||||
return;
|
||||
}
|
||||
AppApi.OpenFolderAndSelectItem(path).then(() => {
|
||||
ElMessage({
|
||||
message: 'Opened image folder',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Opened image folder');
|
||||
});
|
||||
}
|
||||
function deleteMetadata(path) {
|
||||
@@ -298,16 +292,10 @@
|
||||
}
|
||||
AppApi.DeleteScreenshotMetadata(path).then((result) => {
|
||||
if (!result) {
|
||||
ElMessage({
|
||||
message: t('message.screenshot_metadata.delete_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.screenshot_metadata.delete_failed'));
|
||||
return;
|
||||
}
|
||||
ElMessage({
|
||||
message: t('message.screenshot_metadata.deleted'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.screenshot_metadata.deleted'));
|
||||
const D = screenshotMetadataDialog;
|
||||
getAndDisplayScreenshot(D.metadata.filePath, true);
|
||||
});
|
||||
@@ -315,10 +303,7 @@
|
||||
function uploadScreenshotToGallery() {
|
||||
const D = screenshotMetadataDialog;
|
||||
if (D.metadata.fileSizeBytes > 10000000) {
|
||||
ElMessage({
|
||||
message: t('message.file.too_large'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.file.too_large'));
|
||||
return;
|
||||
}
|
||||
D.isUploading = true;
|
||||
@@ -328,10 +313,7 @@
|
||||
.uploadGalleryImage(base64Body)
|
||||
.then((args) => {
|
||||
handleGalleryImageAdd(args);
|
||||
ElMessage({
|
||||
message: t('message.gallery.uploaded'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.gallery.uploaded'));
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -339,10 +321,7 @@
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage({
|
||||
message: t('message.gallery.failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.gallery.failed'));
|
||||
console.error(err);
|
||||
D.isUploading = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user