mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
Don't save default username/realname in local storage
This commit is contained in:
parent
bc7162ebe2
commit
c632ef4339
2 changed files with 14 additions and 3 deletions
|
@ -50,6 +50,17 @@ function parseQueryString() {
|
|||
return params;
|
||||
}
|
||||
|
||||
function fillConnectParams(params) {
|
||||
params = { ...params };
|
||||
if (!params.username) {
|
||||
params.username = params.nick;
|
||||
}
|
||||
if (!params.realname) {
|
||||
params.realname = params.nick;
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
/* Insert a message in an immutable list of sorted messages. */
|
||||
function insertMessage(list, msg) {
|
||||
if (list.length == 0) {
|
||||
|
@ -525,7 +536,7 @@ export default class App extends Component {
|
|||
});
|
||||
this.setState({ connectParams: params });
|
||||
|
||||
var client = new Client(params);
|
||||
var client = new Client(fillConnectParams(params));
|
||||
this.clients.set(netID, client);
|
||||
|
||||
client.addEventListener("status", () => {
|
||||
|
|
|
@ -49,8 +49,8 @@ export default class ConnectForm extends Component {
|
|||
pass: this.state.serverPass,
|
||||
nick: this.state.nick,
|
||||
autoconnect: this.state.rememberMe,
|
||||
username: this.state.username || this.state.nick,
|
||||
realname: this.state.realname || this.state.nick,
|
||||
username: this.state.username,
|
||||
realname: this.state.realname,
|
||||
saslPlain: null,
|
||||
autojoin: [],
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue