mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-30 20:23:46 +02:00
replace ElMessage with Sonner
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user