Reset config.server.auth when using custom server URL

This commit is contained in:
Simon Ser 2021-06-10 18:28:01 +02:00
parent 4df9328be8
commit 77030931cb

View file

@ -175,8 +175,6 @@ export default class App extends Component {
* - Default server URL constructed from the current URL location
*/
handleConfig(config) {
this.config = config;
let connectParams = {};
if (config.server) {
@ -200,6 +198,12 @@ export default class App extends Component {
let queryParams = parseQueryString();
if (queryParams.server) {
connectParams.url = queryParams.server;
// When using a custom server, some configuration options don't
// make sense anymore.
if (config.server) {
config.server.auth = null;
}
}
if (queryParams.nick) {
connectParams.nick = queryParams.nick;
@ -212,6 +216,8 @@ export default class App extends Component {
connectParams.autojoin = window.location.hash.split(",");
}
this.config = config;
this.setState((state) => {
return {
connectParams: {