mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-26 10:13:48 +02:00
replace ElMessage with Sonner
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import Noty from 'noty';
|
||||
@@ -477,10 +478,7 @@ export const useAuthStore = defineStore('Auth', () => {
|
||||
});
|
||||
})
|
||||
.catch((_) => {
|
||||
ElMessage({
|
||||
message: 'Incorrect primary password',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Incorrect primary password');
|
||||
reject(_);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import {
|
||||
checkVRChatCache,
|
||||
@@ -468,10 +469,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
} catch (err) {
|
||||
const msg = `Avatar search failed for ${search} with ${avatarProviderStore.avatarRemoteDatabaseProvider}\n${err}`;
|
||||
console.error(msg);
|
||||
ElMessage({
|
||||
message: msg,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(msg);
|
||||
}
|
||||
} else if (type === 'authorId') {
|
||||
const length =
|
||||
@@ -546,10 +544,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
} catch (err) {
|
||||
const msg = `Avatar lookup failed for ${authorId} with ${url}\n${err}`;
|
||||
console.error(msg);
|
||||
ElMessage({
|
||||
message: msg,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(msg);
|
||||
}
|
||||
return avatars;
|
||||
}
|
||||
@@ -568,10 +563,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
|
||||
async function selectAvatarWithoutConfirmation(id) {
|
||||
if (userStore.currentUser.currentAvatar === id) {
|
||||
ElMessage({
|
||||
message: 'Avatar already selected',
|
||||
type: 'info'
|
||||
});
|
||||
toast.info('Avatar already selected');
|
||||
return;
|
||||
}
|
||||
return avatarRequest
|
||||
@@ -579,10 +571,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
avatarId: id
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'Avatar changed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Avatar changed');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -614,10 +603,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
) {
|
||||
const fileId = extractFileId(currentAvatarImageUrl);
|
||||
if (!fileId) {
|
||||
ElMessage({
|
||||
message: 'Sorry, the author is unknown',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Sorry, the author is unknown');
|
||||
} else if (refUserId === userStore.currentUser.id) {
|
||||
showAvatarDialog(userStore.currentUser.currentAvatar);
|
||||
} else {
|
||||
@@ -637,16 +623,11 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
}
|
||||
if (!avatarId) {
|
||||
if (avatarInfo.ownerId === refUserId) {
|
||||
ElMessage({
|
||||
message:
|
||||
"It's personal (own) avatar or not found in avatar database",
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(
|
||||
"It's personal (own) avatar or not found in avatar database"
|
||||
);
|
||||
} else {
|
||||
ElMessage({
|
||||
message: 'Avatar not found in avatar database',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('Avatar not found in avatar database');
|
||||
userStore.showUserDialog(avatarInfo.ownerId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElNotification } from 'element-plus';
|
||||
import { ElNotification } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { useFriendStore } from './friend';
|
||||
@@ -38,12 +39,8 @@ export const useChartsStore = defineStore('Charts', () => {
|
||||
const friendCount = computed(() => friendStore.friends.size || 0);
|
||||
|
||||
function showInfoMessage(message, type) {
|
||||
ElMessage({
|
||||
message,
|
||||
type,
|
||||
duration: 4000,
|
||||
grouping: true
|
||||
});
|
||||
const toastFn = toast[type] ?? toast;
|
||||
toastFn(message, { duration: 4000 });
|
||||
}
|
||||
|
||||
watch(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, reactive, ref, shallowReactive, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -1071,12 +1071,11 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
*/
|
||||
function renameLocalAvatarFavoriteGroup(newName, group) {
|
||||
if (localAvatarFavoriteGroups.value.includes(newName)) {
|
||||
ElMessage({
|
||||
message: t('prompt.local_favorite_group_rename.message.error', {
|
||||
toast.error(
|
||||
t('prompt.local_favorite_group_rename.message.error', {
|
||||
name: newName
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
localAvatarFavorites[newName] = localAvatarFavorites[group];
|
||||
@@ -1092,12 +1091,11 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
*/
|
||||
function newLocalAvatarFavoriteGroup(group) {
|
||||
if (localAvatarFavoriteGroups.value.includes(group)) {
|
||||
ElMessage({
|
||||
message: t('prompt.new_local_favorite_group.message.error', {
|
||||
toast.error(
|
||||
t('prompt.new_local_favorite_group.message.error', {
|
||||
name: group
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!localAvatarFavorites[group]) {
|
||||
@@ -1355,12 +1353,11 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
*/
|
||||
function renameLocalWorldFavoriteGroup(newName, group) {
|
||||
if (localWorldFavoriteGroups.value.includes(newName)) {
|
||||
ElMessage({
|
||||
message: t('prompt.local_favorite_group_rename.message.error', {
|
||||
toast.error(
|
||||
t('prompt.local_favorite_group_rename.message.error', {
|
||||
name: newName
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
localWorldFavorites[newName] = localWorldFavorites[group];
|
||||
@@ -1474,12 +1471,11 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
*/
|
||||
function newLocalWorldFavoriteGroup(group) {
|
||||
if (localWorldFavoriteGroups.value.includes(group)) {
|
||||
ElMessage({
|
||||
message: t('prompt.new_local_favorite_group.message.error', {
|
||||
toast.error(
|
||||
t('prompt.new_local_favorite_group.message.error', {
|
||||
name: group
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!localWorldFavorites[group]) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -1606,10 +1607,7 @@ export const useFriendStore = defineStore('Friend', () => {
|
||||
}
|
||||
} catch (err) {
|
||||
if (!AppDebug.dontLogMeOut) {
|
||||
ElMessage({
|
||||
message: t('message.friend.load_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('message.friend.load_failed'));
|
||||
authStore.handleLogoutEvent();
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import {
|
||||
deleteVRChatCache as _deleteVRChatCache,
|
||||
@@ -123,10 +124,7 @@ export const useGameStore = defineStore('Game', () => {
|
||||
}
|
||||
AppApi.FocusWindow();
|
||||
const message = 'VRChat crashed, attempting to rejoin last instance';
|
||||
ElMessage({
|
||||
message,
|
||||
type: 'info'
|
||||
});
|
||||
toast(message);
|
||||
const entry = {
|
||||
created_at: new Date().toJSON(),
|
||||
type: 'Event',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { reactive, ref, shallowReactive, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
@@ -1400,11 +1401,9 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
||||
|
||||
async function disableGameLogDialog() {
|
||||
if (gameStore.isGameRunning) {
|
||||
ElMessage({
|
||||
message:
|
||||
'VRChat needs to be closed before this option can be changed',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(
|
||||
'VRChat needs to be closed before this option can be changed'
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!advancedSettingsStore.gameLogDisabled) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { nextTick, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import {
|
||||
groupRequest,
|
||||
@@ -150,10 +151,7 @@ export const useGroupStore = defineStore('Group', () => {
|
||||
.catch((err) => {
|
||||
D.loading = false;
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Failed to load group',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to load group');
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
@@ -596,10 +594,7 @@ export const useGroupStore = defineStore('Group', () => {
|
||||
})
|
||||
.then((args) => {
|
||||
handleGroupMemberProps(args);
|
||||
ElMessage({
|
||||
message: 'Group visibility updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group visibility updated');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
@@ -611,10 +606,7 @@ export const useGroupStore = defineStore('Group', () => {
|
||||
})
|
||||
.then((args) => {
|
||||
handleGroupMemberProps(args);
|
||||
ElMessage({
|
||||
message: 'Group subscription updated',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Group subscription updated');
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -16,8 +16,7 @@ import {
|
||||
hasGroupPermission,
|
||||
isRealInstance,
|
||||
parseLocation,
|
||||
replaceBioSymbols,
|
||||
replaceReactiveObject
|
||||
replaceBioSymbols
|
||||
} from '../shared/utils';
|
||||
import { instanceRequest, userRequest, worldRequest } from '../api';
|
||||
import { database } from '../service/database';
|
||||
@@ -72,6 +71,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
lastUpdated: ''
|
||||
});
|
||||
|
||||
/** @type {import('vue').Ref<any>} */
|
||||
const currentInstanceLocation = ref({});
|
||||
|
||||
const queuedInstances = reactive(new Map());
|
||||
@@ -877,11 +877,8 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
|
||||
function removeAllQueuedInstances() {
|
||||
queuedInstances.forEach((ref) => {
|
||||
ElMessage({
|
||||
message: `Removed instance ${ref.$worldName} from queue`,
|
||||
type: 'info'
|
||||
});
|
||||
ref.$msgBox?.close();
|
||||
toast.info(`Removed instance ${ref.$worldName} from queue`);
|
||||
toast.dismiss(ref.$msgBox);
|
||||
});
|
||||
queuedInstances.clear();
|
||||
}
|
||||
@@ -893,7 +890,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
function removeQueuedInstance(instanceId) {
|
||||
const ref = queuedInstances.get(instanceId);
|
||||
if (typeof ref !== 'undefined') {
|
||||
ref.$msgBox.close();
|
||||
toast.dismiss(ref.$msgBox);
|
||||
queuedInstances.delete(instanceId);
|
||||
}
|
||||
}
|
||||
@@ -905,13 +902,12 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
function applyQueuedInstance(instanceId) {
|
||||
queuedInstances.forEach((ref) => {
|
||||
if (ref.location !== instanceId) {
|
||||
ElMessage({
|
||||
message: t('message.instance.removed_form_queue', {
|
||||
toast.info(
|
||||
t('message.instance.removed_form_queue', {
|
||||
worldName: ref.$worldName
|
||||
}),
|
||||
type: 'info'
|
||||
});
|
||||
ref.$msgBox?.close();
|
||||
})
|
||||
);
|
||||
toast.dismiss(ref.$msgBox);
|
||||
queuedInstances.delete(ref.location);
|
||||
}
|
||||
});
|
||||
@@ -953,7 +949,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
function instanceQueueReady(instanceId) {
|
||||
const ref = queuedInstances.get(instanceId);
|
||||
if (typeof ref !== 'undefined') {
|
||||
ref.$msgBox.close();
|
||||
toast.dismiss(ref.$msgBox);
|
||||
queuedInstances.delete(instanceId);
|
||||
}
|
||||
const L = parseLocation(instanceId);
|
||||
@@ -961,10 +957,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
const groupName = group?.name ?? '';
|
||||
const worldName = ref?.$worldName ?? '';
|
||||
const location = displayLocation(instanceId, worldName, groupName);
|
||||
ElMessage({
|
||||
message: `Instance ready to join ${location}`,
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(`Instance ready to join ${location}`);
|
||||
const noty = {
|
||||
created_at: new Date().toJSON(),
|
||||
type: 'group.queueReady',
|
||||
@@ -1021,14 +1014,16 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
ref.$worldName,
|
||||
ref.$groupName
|
||||
);
|
||||
ref.$msgBox?.close();
|
||||
ref.$msgBox = ElMessage({
|
||||
message: `You are in position ${ref.position} of ${ref.queueSize} in the queue for ${location} `,
|
||||
type: 'info',
|
||||
duration: 0,
|
||||
showClose: true,
|
||||
customClass: 'vrc-instance-queue-message'
|
||||
});
|
||||
toast.dismiss(ref.$msgBox ?? undefined);
|
||||
ref.$msgBox = toast.info(
|
||||
`You are in position ${ref.position} of ${ref.queueSize} in the queue for ${location} `,
|
||||
{
|
||||
duration: Infinity,
|
||||
position: 'bottom-right',
|
||||
closeButton: true,
|
||||
class: 'vrc-instance-queue-message'
|
||||
}
|
||||
);
|
||||
queuedInstances.set(instanceId, ref);
|
||||
// workerTimers.setTimeout(this.instanceQueueTimeout, 3600000);
|
||||
}
|
||||
@@ -1196,7 +1191,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
||||
// $app.methods.instanceQueueClear = function () {
|
||||
// // remove all instances from queue
|
||||
// queuedInstances.forEach((ref) => {
|
||||
// ref.$msgBox.close();
|
||||
// toast.dismiss(ref.$msgBox);
|
||||
// queuedInstances.delete(ref.location);
|
||||
// });
|
||||
// };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import { instanceRequest, inviteMessagesRequest } from '../api';
|
||||
import { parseLocation } from '../shared/utils';
|
||||
@@ -111,10 +111,7 @@ export const useInviteStore = defineStore('Invite', () => {
|
||||
instanceStore.createNewInstance(worldId).then((args) => {
|
||||
const location = args?.json?.location;
|
||||
if (!location) {
|
||||
ElMessage({
|
||||
message: 'Failed to create instance',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to create instance');
|
||||
return;
|
||||
}
|
||||
// self invite
|
||||
@@ -134,10 +131,7 @@ export const useInviteStore = defineStore('Invite', () => {
|
||||
worldId: L.worldId
|
||||
})
|
||||
.then((args) => {
|
||||
ElMessage({
|
||||
message: 'Self invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Self invite sent');
|
||||
return args;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import { instanceRequest } from '../api';
|
||||
import { parseLocation } from '../shared/utils';
|
||||
@@ -103,11 +103,9 @@ export const useLaunchStore = defineStore('Launch', () => {
|
||||
}
|
||||
console.log('Attach Game', launchUrl, result);
|
||||
if (!result) {
|
||||
ElMessage({
|
||||
message:
|
||||
'Failed open instance in VRChat, falling back to self invite',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(
|
||||
'Failed open instance in VRChat, falling back to self invite'
|
||||
);
|
||||
// self invite fallback
|
||||
try {
|
||||
const L = parseLocation(location);
|
||||
@@ -116,10 +114,7 @@ export const useLaunchStore = defineStore('Launch', () => {
|
||||
worldId: L.worldId,
|
||||
shortName
|
||||
});
|
||||
ElMessage({
|
||||
message: 'Self invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Self invite sent');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -157,38 +152,25 @@ export const useLaunchStore = defineStore('Launch', () => {
|
||||
args.join(' ')
|
||||
);
|
||||
if (!result) {
|
||||
ElMessage({
|
||||
message:
|
||||
'Failed to launch VRChat, invalid custom path set',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(
|
||||
'Failed to launch VRChat, invalid custom path set'
|
||||
);
|
||||
} else {
|
||||
ElMessage({
|
||||
message: 'VRChat launched',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRChat launched');
|
||||
}
|
||||
} else {
|
||||
const result = await AppApi.StartGame(args.join(' '));
|
||||
if (!result) {
|
||||
ElMessage({
|
||||
message:
|
||||
'Failed to find VRChat, set a custom path in launch options',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(
|
||||
'Failed to find VRChat, set a custom path in launch options'
|
||||
);
|
||||
} else {
|
||||
ElMessage({
|
||||
message: 'VRChat launched',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRChat launched');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
ElMessage({
|
||||
message: `Failed to launch VRChat: ${e.message}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to launch VRChat: ${e.message}`);
|
||||
}
|
||||
console.log('Launch Game', args.join(' '), desktopMode);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import {
|
||||
@@ -433,10 +434,7 @@ export const usePhotonStore = defineStore('Photon', () => {
|
||||
userStore.lookupUser(ref);
|
||||
}
|
||||
} else {
|
||||
ElMessage({
|
||||
message: 'No user info available',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('No user info available');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
@@ -367,10 +368,7 @@ export const useSearchStore = defineStore('Search', () => {
|
||||
if (action === 'confirm' && value) {
|
||||
const input = value.trim();
|
||||
if (!directAccessParse(input)) {
|
||||
ElMessage({
|
||||
message: t('prompt.direct_access_omni.message.error'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('prompt.direct_access_omni.message.error'));
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { AppDebug } from '../../service/appConfig';
|
||||
import { database } from '../../service/database';
|
||||
import { languageCodes } from '../../localization';
|
||||
import { useGameStore } from '../game';
|
||||
import { useVRCXUpdaterStore } from '../vrcxUpdater';
|
||||
import { useVrcxStore } from '../vrcx';
|
||||
@@ -12,7 +14,6 @@ import { watchState } from '../../service/watchState';
|
||||
|
||||
import configRepository from '../../service/config';
|
||||
import webApiService from '../../service/webapi';
|
||||
import { languageCodes } from '../../localization';
|
||||
|
||||
export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
const gameStore = useGameStore();
|
||||
@@ -162,10 +163,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
configRepository.getString('VRCX_SentryEnabled', '')
|
||||
]);
|
||||
|
||||
if (
|
||||
!bioLanguageConfig ||
|
||||
!languageCodes.includes(bioLanguageConfig)
|
||||
) {
|
||||
if (!bioLanguageConfig || !languageCodes.includes(bioLanguageConfig)) {
|
||||
bioLanguage.value = 'en';
|
||||
} else {
|
||||
bioLanguage.value = bioLanguageConfig;
|
||||
@@ -628,10 +626,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
|
||||
async function translateText(text, targetLang, overrides) {
|
||||
if (!translationApi.value) {
|
||||
ElMessage({
|
||||
message: 'Translation API disabled',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('Translation API disabled');
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -641,10 +636,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
if (provider === 'google') {
|
||||
const keyToUse = overrides?.key ?? translationApiKey.value;
|
||||
if (!keyToUse) {
|
||||
ElMessage({
|
||||
message: 'No Translation API key configured',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('No Translation API key configured');
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
@@ -672,10 +664,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
}
|
||||
return data.data.translations[0].translatedText;
|
||||
} catch (err) {
|
||||
ElMessage({
|
||||
message: `Translation failed: ${err.message}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Translation failed: ${err.message}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -692,10 +681,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
`You are a translation assistant. Translate the user message into ${targetLang}. Only return the translated text.`;
|
||||
|
||||
if (!endpoint || !model) {
|
||||
ElMessage({
|
||||
message: 'Translation endpoint/model missing',
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning('Translation endpoint/model missing');
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -742,10 +728,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
const translated = data?.choices?.[0]?.message?.content;
|
||||
return typeof translated === 'string' ? translated.trim() : null;
|
||||
} catch (err) {
|
||||
ElMessage({
|
||||
message: `Translation failed: ${err.message}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Translation failed: ${err.message}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -769,25 +752,18 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
)
|
||||
.then(async ({ action }) => {
|
||||
if (action === 'confirm') {
|
||||
const msgBox = ElMessage({
|
||||
message: 'Batch print cropping in progress...',
|
||||
type: 'warning',
|
||||
duration: 0
|
||||
});
|
||||
const msgBox = toast.warning(
|
||||
'Batch print cropping in progress...',
|
||||
{ duration: Infinity, position: 'bottom-right' }
|
||||
);
|
||||
try {
|
||||
await AppApi.CropAllPrints(ugcFolderPath.value);
|
||||
ElMessage({
|
||||
message: 'Batch print cropping complete',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Batch print cropping complete');
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Batch print cropping failed: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Batch print cropping failed: ${err}`);
|
||||
} finally {
|
||||
msgBox.close();
|
||||
toast.dismiss(msgBox);
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -836,25 +812,18 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
)
|
||||
.then(async ({ action }) => {
|
||||
if (action === 'confirm') {
|
||||
const msgBox = ElMessage({
|
||||
message: 'Batch metadata removal in progress...',
|
||||
type: 'warning',
|
||||
duration: 0
|
||||
});
|
||||
const msgBox = toast.warning(
|
||||
'Batch metadata removal in progress...',
|
||||
{ duration: Infinity, position: 'bottom-right' }
|
||||
);
|
||||
try {
|
||||
await AppApi.DeleteAllScreenshotMetadata();
|
||||
ElMessage({
|
||||
message: 'Batch metadata removal complete',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Batch metadata removal complete');
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `Batch metadata removal failed: ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Batch metadata removal failed: ${err}`);
|
||||
} finally {
|
||||
msgBox.close();
|
||||
toast.dismiss(msgBox);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useMagicKeys } from '@vueuse/core';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
@@ -54,10 +54,7 @@ export const useUiStore = defineStore('Ui', () => {
|
||||
if (isPressed) {
|
||||
refreshCustomCss();
|
||||
updateLocalizedStrings();
|
||||
ElMessage({
|
||||
message: 'Custom CSS and localization strings refreshed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Custom CSS and localization strings refreshed');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, reactive, ref, shallowReactive, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import Noty from 'noty';
|
||||
|
||||
@@ -842,10 +842,7 @@ export const useUserStore = defineStore('User', () => {
|
||||
.catch((err) => {
|
||||
D.loading = false;
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Failed to load user',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to load user');
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
@@ -1218,10 +1215,7 @@ export const useUserStore = defineStore('User', () => {
|
||||
return;
|
||||
}
|
||||
}
|
||||
ElMessage({
|
||||
message: 'Own avatar not found',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Own avatar not found');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import Noty from 'noty';
|
||||
@@ -160,12 +161,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
let msgBox;
|
||||
if (state.databaseVersion < databaseVersion) {
|
||||
if (state.databaseVersion) {
|
||||
msgBox = ElMessage({
|
||||
message:
|
||||
'DO NOT CLOSE VRCX, database upgrade in progress...',
|
||||
type: 'warning',
|
||||
duration: 0
|
||||
});
|
||||
msgBox = toast.warning(
|
||||
'DO NOT CLOSE VRCX, database upgrade in progress...',
|
||||
{ duration: Infinity, position: 'bottom-right' }
|
||||
);
|
||||
}
|
||||
console.log(
|
||||
`Updating database from ${state.databaseVersion} to ${databaseVersion}...`
|
||||
@@ -188,24 +187,19 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
databaseVersion
|
||||
);
|
||||
console.log('Database update complete.');
|
||||
msgBox?.close();
|
||||
toast.dismiss(msgBox);
|
||||
if (state.databaseVersion) {
|
||||
// only display when database exists
|
||||
ElMessage({
|
||||
message: 'Database upgrade complete',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Database upgrade complete');
|
||||
}
|
||||
state.databaseVersion = databaseVersion;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
msgBox?.close();
|
||||
ElMessage({
|
||||
message:
|
||||
'Database upgrade failed, check console for details',
|
||||
type: 'error',
|
||||
duration: 120000
|
||||
});
|
||||
toast.dismiss(msgBox);
|
||||
toast.error(
|
||||
'Database upgrade failed, check console for details',
|
||||
{ duration: 120000 }
|
||||
);
|
||||
AppApi.ShowDevTools();
|
||||
}
|
||||
}
|
||||
@@ -365,12 +359,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
} catch (e) {
|
||||
console.error('Failed to add screenshot metadata', e);
|
||||
if (e.message?.includes('UnauthorizedAccessException')) {
|
||||
ElMessage({
|
||||
message:
|
||||
'Failed to add screenshot metadata, access denied. Make sure VRCX has permission to access the screenshot folder.',
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
toast.error(
|
||||
'Failed to add screenshot metadata, access denied. Make sure VRCX has permission to access the screenshot folder.',
|
||||
{ duration: 10000 }
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -547,10 +539,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
}
|
||||
|
||||
ElMessage({
|
||||
message: t('message.crash.vrcx_reload'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('message.crash.vrcx_reload'));
|
||||
return;
|
||||
}
|
||||
eventLaunchCommand(command);
|
||||
@@ -603,10 +592,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
const regexAvatarId =
|
||||
/avtr_[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}/g;
|
||||
if (!avatarId.match(regexAvatarId) || avatarId.length !== 41) {
|
||||
ElMessage({
|
||||
message: 'Invalid Avatar ID',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid Avatar ID');
|
||||
break;
|
||||
}
|
||||
if (advancedSettingsStore.showConfirmationOnSwitchAvatar) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { AppDebug } from '../service/appConfig';
|
||||
@@ -211,12 +211,11 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
||||
checkingForVRCXUpdate.value = false;
|
||||
}
|
||||
if (response.status !== 200) {
|
||||
ElMessage({
|
||||
message: t('message.vrcx_updater.failed', {
|
||||
toast.error(
|
||||
t('message.vrcx_updater.failed', {
|
||||
message: `${response.status} ${response.data}`
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
pendingVRCXUpdate.value = false;
|
||||
@@ -290,12 +289,11 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
||||
checkingForVRCXUpdate.value = false;
|
||||
}
|
||||
if (response.status !== 200) {
|
||||
ElMessage({
|
||||
message: t('message.vrcx_updater.failed', {
|
||||
toast.error(
|
||||
t('message.vrcx_updater.failed', {
|
||||
message: `${response.status} ${response.data}`
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (AppDebug.debugWebRequests) {
|
||||
@@ -303,12 +301,11 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
||||
}
|
||||
const releases = [];
|
||||
if (typeof json !== 'object' || json.message) {
|
||||
ElMessage({
|
||||
message: t('message.vrcx_updater.failed', {
|
||||
toast.error(
|
||||
t('message.vrcx_updater.failed', {
|
||||
message: json.message
|
||||
}),
|
||||
type: 'error'
|
||||
});
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
for (const release of json) {
|
||||
@@ -347,10 +344,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
||||
pendingVRCXInstall.value = releaseName;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ElMessage({
|
||||
message: `${t('message.vrcx_updater.failed_install')} ${err}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`${t('message.vrcx_updater.failed_install')} ${err}`);
|
||||
} finally {
|
||||
updateInProgress.value = false;
|
||||
updateProgress.value = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { reactive, shallowReactive, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
import {
|
||||
checkVRChatCache,
|
||||
@@ -132,10 +132,7 @@ export const useWorldStore = defineStore('World', () => {
|
||||
.catch((err) => {
|
||||
D.loading = false;
|
||||
D.visible = false;
|
||||
ElMessage({
|
||||
message: 'Failed to load world',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Failed to load world');
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
|
||||
Reference in New Issue
Block a user