Disable invite button for friends/invite only instances to reflect API

This commit is contained in:
Natsumi
2021-06-19 09:35:33 +12:00
parent 780a4a71dc
commit bd297deba6
3 changed files with 23 additions and 6 deletions

View File

@@ -110,18 +110,25 @@ button {
color: #c5cad6;
}
.el-button:not(.el-button--text, .el-button--primary) {
.el-button:not(.el-button--text, .el-button--primary, .is-disabled) {
background-color: #353535;
border-color: #404040;
}
.el-button:not(.el-button--text, .el-button--primary):focus,
.el-button:not(.el-button--text, .el-button--primary):hover {
.el-button:not(.el-button--text, .el-button--primary, .is-disabled):focus,
.el-button:not(.el-button--text, .el-button--primary, .is-disabled):hover {
color: #000;
background-color: #737373;
border-color: #656565;
}
.el-button.is-disabled,
.el-button.is-disabled:focus,
.el-button.is-disabled:hover {
background-color: #292929;
border-color: #3d3d3d;
}
.el-tabs__item {
color: #c2c4ca;
}

View File

@@ -12938,6 +12938,17 @@ speechSynthesis.getVoices();
return text;
};
$app.methods.checkCanInvite = function (location) {
var L = API.parseLocation(location);
if ((L.accessType === 'invite') || (L.accessType === 'friends')) {
if (L.userId === API.currentUser.id) {
return false;
}
return true;
}
return false;
};
$app = new Vue($app);
window.$app = $app;
}());

View File

@@ -1080,7 +1080,7 @@ html
template(v-if="userDialog.isFriend")
el-dropdown-item(icon="el-icon-postcard" command="Request Invite" divided) Request Invite
el-dropdown-item(icon="el-icon-postcard" command="Request Invite Message") Request Invite With Message
template(v-if="lastLocation.location && isGameRunning")
template(v-if="lastLocation.location && isGameRunning && !checkCanInvite(this.lastLocation.location)")
el-dropdown-item(icon="el-icon-message" command="Invite") Invite
el-dropdown-item(icon="el-icon-message" command="Invite Message") Invite With Message
template(v-else-if="userDialog.incomingRequest")
@@ -1573,7 +1573,6 @@ html
el-form-item(label="URL")
el-input(v-model="newInstanceDialog.url" size="mini" readonly @click.native="$event.target.tagName === 'INPUT' && $event.target.select()")
template(#footer)
el-button(size="small" @click="makeHome(newInstanceDialog.location)") Make Home
el-button(size="small" @click="copyInstanceUrl(newInstanceDialog.url)") Copy URL
el-button(size="small" @click="selfInvite(newInstanceDialog.location)") Self Invite
el-button(size="small" @click="showInviteDialog(newInstanceDialog.location)") Invite
@@ -1667,7 +1666,7 @@ html
div #[span(v-text="launchDialog.url" style="word-break:break-all;font-size:12px")]
template(#footer)
el-checkbox(v-model="launchDialog.desktop" style="float:left;margin-top:5px") Start as Desktop (No VR)
el-button(size="small" @click="showInviteDialog(launchDialog.location)") Invite
el-button(size="small" @click="showInviteDialog(launchDialog.location)" :disabled="checkCanInvite(launchDialog.location)") Invite
el-button(type="primary" size="small" @click="launchGame(locationToLaunchArg(launchDialog.location))") Launch
//- dialog: export friends list