Add button to enable protocol handler in settings

This commit is contained in:
Simon Ser
2022-06-27 17:01:15 +02:00
parent 7cabb6f85b
commit fa80a56516
3 changed files with 48 additions and 1 deletions

View File

@@ -1697,7 +1697,15 @@ export default class App extends Component {
}
handleOpenSettingsClick() {
this.openDialog("settings");
let showProtocolHandler = false;
for (let [id, client] of this.clients) {
if (client.caps.enabled.has("soju.im/bouncer-networks")) {
showProtocolHandler = true;
break;
}
}
this.openDialog("settings", { showProtocolHandler });
}
handleSettingsChange(settings) {
@@ -1880,6 +1888,7 @@ export default class App extends Component {
<${Dialog} title="Settings" onDismiss=${this.dismissDialog}>
<${SettingsForm}
settings=${this.state.settings}
showProtocolHandler=${dialogData.showProtocolHandler}
onChange=${this.handleSettingsChange}
onDisconnect=${() => this.disconnectAll()}
onClose=${() => this.dismissDialog()}