mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-22 00:03:51 +02:00
Fix self invite
This commit is contained in:
@@ -766,9 +766,9 @@ speechSynthesis.getVoices();
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
var L = API.parseLocation(this.location);
|
||||
this.$el.style.display =
|
||||
L.isOffline || L.isPrivate || L.isTraveling ? 'none' : '';
|
||||
this.$el.style.display = $app.checkCanInviteSelf()
|
||||
? 'none'
|
||||
: '';
|
||||
},
|
||||
confirm() {
|
||||
API.$emit('SHOW_LAUNCH_DIALOG', this.location);
|
||||
@@ -792,9 +792,9 @@ speechSynthesis.getVoices();
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
var L = API.parseLocation(this.location);
|
||||
this.$el.style.display =
|
||||
L.isOffline || L.isPrivate || L.isTraveling ? 'none' : '';
|
||||
this.$el.style.display = $app.checkCanInviteSelf()
|
||||
? 'none'
|
||||
: '';
|
||||
},
|
||||
confirm() {
|
||||
var L = API.parseLocation(this.location);
|
||||
@@ -2017,7 +2017,7 @@ speechSynthesis.getVoices();
|
||||
*/
|
||||
API.selfInvite = function (params) {
|
||||
return this.call(
|
||||
`instances/${params.worldId}:${params.instanceId}/invite`,
|
||||
`invite/myself/to/${params.worldId}:${params.instanceId}`,
|
||||
{
|
||||
method: 'POST'
|
||||
}
|
||||
@@ -18600,6 +18600,14 @@ speechSynthesis.getVoices();
|
||||
};
|
||||
|
||||
$app.methods.checkCanInvite = function (location) {
|
||||
var L = API.parseLocation(location);
|
||||
if (L.accessType === 'public' || L.userId === API.currentUser.id) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
$app.methods.checkCanInviteSelf = function (location) {
|
||||
var L = API.parseLocation(location);
|
||||
if (L.accessType === 'invite' || L.accessType === 'friends') {
|
||||
if (L.userId === API.currentUser.id) {
|
||||
|
||||
Reference in New Issue
Block a user