replace ElMessage with Sonner

This commit is contained in:
pa
2026-01-07 19:16:31 +09:00
committed by Natsumi
parent f819a3f500
commit 7e4de15ef2
85 changed files with 574 additions and 1144 deletions

View File

@@ -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);
}