mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-22 08:13:52 +02:00
replace ElMessage with Sonner
This commit is contained in:
@@ -104,10 +104,11 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { Setting } from '@element-plus/icons-vue';
|
||||
import { onBeforeRouteLeave } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useAppearanceSettingsStore, useChartsStore, useFriendStore, useUserStore } from '../../../stores';
|
||||
@@ -173,7 +174,7 @@
|
||||
const progressPercent = computed(() =>
|
||||
totalFriends.value ? Math.min(100, Math.round((fetchState.processedFriends / totalFriends.value) * 100)) : 0
|
||||
);
|
||||
const progressStatus = computed(() => (isFetching.value ? 'warning' : undefined));
|
||||
const progressStatus = computed(() => (isFetching.value ? 'warning' : ''));
|
||||
const forceDefaults = computed(() =>
|
||||
computeForceOptions(graphPayload.value?.nodes ?? [], graphPayload.value?.links ?? [])
|
||||
);
|
||||
@@ -293,13 +294,8 @@
|
||||
if (!message) {
|
||||
return;
|
||||
}
|
||||
ElMessage({
|
||||
// @ts-ignore
|
||||
message,
|
||||
type,
|
||||
duration: 4000,
|
||||
grouping: true
|
||||
});
|
||||
const toastFn = toast[type] ?? toast;
|
||||
toastFn(message, { duration: 4000 });
|
||||
}
|
||||
|
||||
function createChartInstance() {
|
||||
@@ -613,7 +609,7 @@
|
||||
|
||||
const hasInvalid = [repulsion, minEdge, maxEdge, gravity].some((entry) => entry.invalid);
|
||||
if (hasInvalid) {
|
||||
ElMessage.error(t('view.charts.mutual_friend.force_dialog.invalid_input'));
|
||||
toast.error(t('view.charts.mutual_friend.force_dialog.invalid_input'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -497,9 +497,10 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, h, nextTick, onBeforeMount, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox, ElNotification, ElProgress } from 'element-plus';
|
||||
import { Loading, MoreFilled, Plus, Refresh } from '@element-plus/icons-vue';
|
||||
import { ElMessageBox, ElNotification, ElProgress } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useAppearanceSettingsStore, useAvatarStore, useFavoriteStore, useUserStore } from '../../stores';
|
||||
@@ -1191,16 +1192,10 @@
|
||||
navigator.clipboard
|
||||
.writeText(result.invalidIds.join('\n'))
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: t('view.favorite.avatars.copied_ids'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('view.favorite.avatars.copied_ids'));
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
message: 'Failed to copy',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to copy');
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -1285,10 +1280,7 @@
|
||||
favoriteGroupId: args.json.id
|
||||
}
|
||||
});
|
||||
ElMessage({
|
||||
message: t('prompt.change_favorite_group_name.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_favorite_group_name.message.success'));
|
||||
refreshFavorites();
|
||||
});
|
||||
})
|
||||
@@ -1308,10 +1300,7 @@
|
||||
favoriteGroupId: args.json.id
|
||||
}
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Group visibility changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group visibility changed');
|
||||
if (menuKey) {
|
||||
handleGroupMenuVisible(menuKey, false);
|
||||
}
|
||||
|
||||
@@ -281,9 +281,10 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, onBeforeMount, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { MoreFilled, Refresh } from '@element-plus/icons-vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useAppearanceSettingsStore, useFavoriteStore, useUserStore } from '../../stores';
|
||||
@@ -678,10 +679,7 @@
|
||||
favoriteGroupId: args.json.id
|
||||
}
|
||||
});
|
||||
ElMessage({
|
||||
message: t('prompt.change_favorite_group_name.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_favorite_group_name.message.success'));
|
||||
refreshFavorites();
|
||||
});
|
||||
})
|
||||
@@ -701,10 +699,7 @@
|
||||
favoriteGroupId: args.json.id
|
||||
}
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Group visibility changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group visibility changed');
|
||||
if (menuKey) {
|
||||
handleGroupMenuVisible(menuKey, false);
|
||||
}
|
||||
|
||||
@@ -407,8 +407,9 @@
|
||||
<script setup>
|
||||
import { computed, nextTick, onBeforeMount, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { Loading, MoreFilled, Plus, Refresh } 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 { useAppearanceSettingsStore, useFavoriteStore, useWorldStore } from '../../stores';
|
||||
@@ -979,10 +980,7 @@
|
||||
favoriteGroupId: args.json.id
|
||||
}
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Group visibility changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group visibility changed');
|
||||
if (menuKey) {
|
||||
handleGroupMenuVisible(menuKey, false);
|
||||
}
|
||||
@@ -1121,10 +1119,7 @@
|
||||
favoriteGroupId: args.json.id
|
||||
}
|
||||
});
|
||||
ElMessage({
|
||||
message: t('prompt.change_favorite_group_name.message.success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('prompt.change_favorite_group_name.message.success'));
|
||||
refreshFavorites();
|
||||
});
|
||||
})
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
<script setup>
|
||||
import { Back } 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 { favoriteRequest } from '../../../api';
|
||||
@@ -89,10 +89,7 @@
|
||||
tags: groupAPI.name
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Avatar added to favorites',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar added to favorites');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -105,7 +102,7 @@
|
||||
tags: groupAPI.name
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({ message: 'World added to favorites', type: 'success' });
|
||||
toast.success('World added to favorites');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ArrowDown } 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 { useAvatarStore, useFavoriteStore } from '../../../stores';
|
||||
@@ -153,18 +153,11 @@
|
||||
navigator.clipboard
|
||||
.writeText(avatarExportContent.value)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'Copied successfully!',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
toast.success('Copied successfully!', { duration: 2000 });
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Copy failed:', err);
|
||||
ElMessage({
|
||||
message: 'Copy failed!',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Copy failed!');
|
||||
});
|
||||
}
|
||||
function updateAvatarExportDialog() {
|
||||
|
||||
@@ -178,8 +178,8 @@
|
||||
<script setup>
|
||||
import { ArrowDown, Close, Loading } from '@element-plus/icons-vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useAvatarStore, useFavoriteStore, useGalleryStore, useUserStore } from '../../../stores';
|
||||
@@ -324,10 +324,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
if (message) {
|
||||
ElMessage({
|
||||
message: 'Avatar added to favorites',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar added to favorites');
|
||||
}
|
||||
return args;
|
||||
});
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ArrowDown } 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 { useFavoriteStore } from '../../../stores';
|
||||
@@ -100,18 +100,11 @@
|
||||
navigator.clipboard
|
||||
.writeText(friendExportContent.value)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'Copied successfully!',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
toast.success('Copied successfully!', { duration: 2000 });
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Copy failed:', err);
|
||||
ElMessage({
|
||||
message: 'Copy failed!',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Copy failed!');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,8 @@
|
||||
<script setup>
|
||||
import { ArrowDown, Close, Loading } from '@element-plus/icons-vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { removeFromArray, userImage, userImageFull } from '../../../shared/utils';
|
||||
@@ -242,10 +242,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
if (message) {
|
||||
ElMessage({
|
||||
message: 'Friend added to favorites',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Friend added to favorites');
|
||||
}
|
||||
return args;
|
||||
});
|
||||
|
||||
@@ -82,8 +82,8 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ArrowDown } 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 { useFavoriteStore, useWorldStore } from '../../../stores';
|
||||
@@ -153,18 +153,11 @@
|
||||
navigator.clipboard
|
||||
.writeText(worldExportContent.value)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'Copied successfully!',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
toast.success('Copied successfully!', { duration: 2000 });
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Copy failed:', err);
|
||||
ElMessage({
|
||||
message: 'Copy failed!',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Copy failed!');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -174,8 +174,8 @@
|
||||
<script setup>
|
||||
import { ArrowDown, Close, Loading } from '@element-plus/icons-vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useFavoriteStore, useGalleryStore, useUserStore, useWorldStore } from '../../../stores';
|
||||
@@ -355,10 +355,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
if (message) {
|
||||
ElMessage({
|
||||
message: 'World added to favorites',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('World added to favorites');
|
||||
}
|
||||
return args;
|
||||
});
|
||||
|
||||
@@ -265,8 +265,9 @@
|
||||
|
||||
<script setup>
|
||||
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 { useRoute } from 'vue-router';
|
||||
|
||||
@@ -449,7 +450,7 @@
|
||||
friendsListLoadingTotal.value = total;
|
||||
friendsListLoadingCurrent.value = 0;
|
||||
if (!total) {
|
||||
ElMessage.success(t('view.friend_list.load_complete'));
|
||||
toast.success(t('view.friend_list.load_complete'));
|
||||
return;
|
||||
}
|
||||
friendsListLoading.value = true;
|
||||
@@ -472,7 +473,7 @@
|
||||
friendsListLoadingCurrent.value = 0;
|
||||
friendsListLoadingTotal.value = 0;
|
||||
if (!cancelled) {
|
||||
ElMessage.success(t('view.friend_list.load_complete'));
|
||||
toast.success(t('view.friend_list.load_complete'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +78,10 @@
|
||||
useVueTable
|
||||
} from '@tanstack/vue-table';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import Noty from 'noty';
|
||||
@@ -376,7 +377,7 @@
|
||||
row.senderUserId
|
||||
)
|
||||
.then((_args) => {
|
||||
ElMessage('Invite sent');
|
||||
toast('Invite sent');
|
||||
notificationRequest.hideNotification({
|
||||
notificationId: row.id
|
||||
});
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { inviteMessagesRequest, notificationRequest } from '../../../api';
|
||||
@@ -79,13 +79,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;
|
||||
});
|
||||
@@ -104,10 +101,7 @@
|
||||
notificationRequest.hideNotification({
|
||||
notificationId: I.invite.id
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Invite response message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite response message sent');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -123,10 +117,7 @@
|
||||
notificationRequest.hideNotification({
|
||||
notificationId: I.invite.id
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Invite response message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite response message sent');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { notificationRequest } from '../../../api';
|
||||
@@ -65,10 +65,7 @@
|
||||
notificationRequest.hideNotification({
|
||||
notificationId: D.invite.id
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Invite response photo message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite response photo message sent');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -84,10 +81,7 @@
|
||||
notificationRequest.hideNotification({
|
||||
notificationId: D.invite.id
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Invite response message sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Invite response message sent');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -283,10 +283,12 @@
|
||||
})
|
||||
);
|
||||
|
||||
const playerListDisplayData = computed(() => currentInstanceUsersData.value ?? []);
|
||||
|
||||
const playerListTable = useVueTable({
|
||||
data: currentInstanceUsersData.value,
|
||||
data: playerListDisplayData,
|
||||
columns: playerListColumns.value,
|
||||
getRowId: (row) => `${row?.ref?.id ?? ''}:${row?.displayName ?? ''}`,
|
||||
getRowId: (row) => `${row?.ref?.id ?? ''}:${row?.displayName ?? ''}:${row?.photonId ?? ''}`,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
getSortedRowModel: getSortedRowModel(),
|
||||
@@ -310,6 +312,28 @@
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
playerListColumns,
|
||||
(next) => {
|
||||
playerListTable.setOptions((prev) => ({
|
||||
...prev,
|
||||
columns: next
|
||||
}));
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
playerListDisplayData,
|
||||
(next) => {
|
||||
playerListTable.setOptions((prev) => ({
|
||||
...prev,
|
||||
data: next
|
||||
}));
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const playerListTotalItems = computed(() => playerListTable.getRowModel().rows.length);
|
||||
|
||||
const handlePlayerListRowClick = (row) => {
|
||||
|
||||
@@ -390,8 +390,8 @@
|
||||
User
|
||||
} from '@element-plus/icons-vue';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -503,15 +503,9 @@
|
||||
function openVrcxAppDataFolder() {
|
||||
AppApi.OpenVrcxAppDataFolder().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");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -519,15 +513,9 @@
|
||||
function openVrcAppDataFolder() {
|
||||
AppApi.OpenVrcAppDataFolder().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");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -535,15 +523,9 @@
|
||||
function openCrashVrcCrashDumps() {
|
||||
AppApi.OpenCrashVrcCrashDumps().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");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -386,8 +386,8 @@
|
||||
<script setup>
|
||||
import { ArrowDown, ArrowRight, Notebook } from '@element-plus/icons-vue';
|
||||
import { computed, onBeforeUnmount, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useAppearanceSettingsStore, useFavoriteStore, useVrStore } from '../../../../stores';
|
||||
@@ -474,10 +474,7 @@
|
||||
const rawLength = Array.isArray(values) ? values.length : 0;
|
||||
setTablePageSizes(values);
|
||||
if (rawLength && rawLength !== tablePageSizes.value.length) {
|
||||
ElMessage({
|
||||
message: t('view.settings.appearance.appearance.table_page_sizes_error'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('view.settings.appearance.appearance.table_page_sizes_error'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { Badge } from '../../../components/ui/badge';
|
||||
@@ -104,17 +104,11 @@
|
||||
D.vrcLaunchPathOverride.endsWith('.exe') &&
|
||||
!D.vrcLaunchPathOverride.endsWith('launch.exe')
|
||||
) {
|
||||
ElMessage({
|
||||
message: 'Invalid path, you must enter VRChat folder or launch.exe',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid path, you must enter VRChat folder or launch.exe');
|
||||
return;
|
||||
}
|
||||
configRepository.setString('vrcLaunchPathOverride', D.vrcLaunchPathOverride);
|
||||
ElMessage({
|
||||
message: 'Updated launch options',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Updated launch options');
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,10 @@
|
||||
|
||||
<script setup>
|
||||
import { Delete, Download, Upload } from '@element-plus/icons-vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { downloadAndSaveJson, formatDateFilter, removeFromArray } from '../../../shared/utils';
|
||||
@@ -134,17 +135,11 @@
|
||||
const data = JSON.stringify(row.data);
|
||||
AppApi.SetVRChatRegistry(data)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'VRC registry settings restored',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRC registry settings restored');
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage({
|
||||
message: `Failed to restore VRC registry settings, check console for full error: ${e}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to restore VRC registry settings, check console for full error: ${e}`);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -172,10 +167,7 @@
|
||||
return;
|
||||
}
|
||||
AppApi.DeleteVRChatRegistryFolder().then(() => {
|
||||
ElMessage({
|
||||
message: 'VRC registry settings deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRC registry settings deleted');
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -256,23 +248,14 @@
|
||||
}
|
||||
AppApi.SetVRChatRegistry(json)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'VRC registry settings restored',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRC registry settings restored');
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage({
|
||||
message: `Failed to restore VRC registry settings, check console for full error: ${e}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to restore VRC registry settings, check console for full error: ${e}`);
|
||||
});
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Invalid JSON',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid JSON');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import { ArrowDown } 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 { getLanguageName, languageCodes } from '../../../localization';
|
||||
@@ -173,10 +173,7 @@
|
||||
async function saveTranslationApiConfig() {
|
||||
if (form.translationApiType === 'openai') {
|
||||
if (!form.translationApiEndpoint || !form.translationApiModel) {
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_fill_endpoint_model'),
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(t('dialog.translation_api.msg_fill_endpoint_model'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -189,10 +186,7 @@
|
||||
setTranslationApiKey(form.translationApiKey)
|
||||
]);
|
||||
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_settings_saved'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('dialog.translation_api.msg_settings_saved'));
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
@@ -201,10 +195,7 @@
|
||||
return;
|
||||
}
|
||||
if (!form.translationApiEndpoint || !form.translationApiModel) {
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_fill_endpoint_model'),
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(t('dialog.translation_api.msg_fill_endpoint_model'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -218,23 +209,14 @@
|
||||
key: form.translationApiKey
|
||||
});
|
||||
if (data) {
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_test_success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('dialog.translation_api.msg_test_success'));
|
||||
} else {
|
||||
console.error('[TranslationAPI] Test returned empty result');
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_test_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('dialog.translation_api.msg_test_failed'));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[TranslationAPI] Test failed', err);
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_test_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('dialog.translation_api.msg_test_failed'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,8 +183,9 @@
|
||||
<script setup>
|
||||
import { ArrowDown, Delete, FolderDelete, FolderOpened, Refresh } from '@element-plus/icons-vue';
|
||||
import { computed, 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 { VRChatCameraResolutions, VRChatScreenshotResolutions } from '../../../shared/constants';
|
||||
@@ -279,15 +280,9 @@
|
||||
async function deleteAllVRChatCache() {
|
||||
try {
|
||||
await AssetBundleManager.DeleteAllCache();
|
||||
ElMessage({
|
||||
message: 'All VRChat cache deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('All VRChat cache deleted');
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: `Error deleting VRChat cache: ${error.message}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Error deleting VRChat cache: ${error.message}`);
|
||||
}
|
||||
getVRChatCacheSize();
|
||||
}
|
||||
@@ -379,10 +374,7 @@
|
||||
const parsedConfig = JSON.parse(config);
|
||||
VRChatConfigFile.value = { ...VRChatConfigFile.value, ...parsedConfig };
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Invalid JSON in config.json',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid JSON in config.json');
|
||||
throw new Error('Invalid JSON in config.json');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { openExternalLink } from '../../../shared/utils';
|
||||
@@ -57,26 +57,17 @@
|
||||
async function testYouTubeApiKey() {
|
||||
const previousKey = youTubeApiKey.value;
|
||||
if (!youTubeApiKey.value) {
|
||||
ElMessage({
|
||||
message: 'YouTube API key removed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('YouTube API key removed');
|
||||
closeDialog();
|
||||
return;
|
||||
}
|
||||
const data = await lookupYouTubeVideo('dQw4w9WgXcQ');
|
||||
if (!data) {
|
||||
setYouTubeApiKey(previousKey);
|
||||
ElMessage({
|
||||
message: 'Invalid YouTube API key',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid YouTube API key');
|
||||
} else {
|
||||
setYouTubeApiKey(youTubeApiKey.value);
|
||||
ElMessage({
|
||||
message: 'YouTube API key valid!',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('YouTube API key valid!');
|
||||
closeDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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