mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 22:36:05 +02:00
refactor: launch dialog and new instance dialog (#1191)
* refactor: launch dialog and new instance dialog * fix * fix
This commit is contained in:
@@ -1188,7 +1188,8 @@ export default class extends baseClass {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('GROUP:ROLES', args);
|
||||
// useless code?
|
||||
// this.$emit('GROUP:ROLES', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -71,7 +71,6 @@ const instanceReq = {
|
||||
instance,
|
||||
params
|
||||
};
|
||||
window.API.$emit('INSTANCE:SHORTNAME', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
@@ -95,7 +94,7 @@ const instanceReq = {
|
||||
|
||||
/**
|
||||
* Send invite to current user.
|
||||
* @param {{ worldId: string, instanceId: string, shortName: string }} instance
|
||||
* @param {{ worldId: string, instanceId: string, shortName?: string }} instance
|
||||
* @returns {Promise<{instance, json: any, params}>}
|
||||
*/
|
||||
selfInvite(instance) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Vue from 'vue';
|
||||
import VueMarkdown from 'vue-markdown';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
import { userRequest } from './request';
|
||||
import { instanceRequest, userRequest } from './request';
|
||||
import utils from './utils';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
@@ -56,7 +57,26 @@ export default class extends baseClass {
|
||||
: 'none';
|
||||
},
|
||||
confirm() {
|
||||
$app.selfInvite(this.location, this.shortname);
|
||||
this.selfInvite(this.location, this.shortname);
|
||||
},
|
||||
selfInvite(location, shortName) {
|
||||
const L = utils.parseLocation(location);
|
||||
if (!L.isRealInstance) {
|
||||
return;
|
||||
}
|
||||
instanceRequest
|
||||
.selfInvite({
|
||||
instanceId: L.instanceId,
|
||||
worldId: L.worldId,
|
||||
shortName
|
||||
})
|
||||
.then((args) => {
|
||||
this.$message({
|
||||
message: 'Self invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user