Remember last used nick and realname, closes #43

This commit is contained in:
Ken-Håvard Lieng 2020-05-21 05:57:05 +02:00
parent 35727fb2b8
commit 99b3ff519b
2 changed files with 55 additions and 50 deletions

File diff suppressed because one or more lines are too long

View File

@ -168,11 +168,11 @@ export default withFormik({
name: query.name || defaults.name, name: query.name || defaults.name,
host: query.host || defaults.host, host: query.host || defaults.host,
port, port,
nick: query.nick || '', nick: query.nick || localStorage.lastNick || '',
channels: channels || defaults.channels.join(','), channels: channels || defaults.channels.join(','),
username: query.username || '', username: query.username || '',
password: defaults.password ? ' ' : '', password: defaults.password ? ' ' : '',
realname: query.realname || '', realname: query.realname || localStorage.lastRealname || '',
tls: ssl tls: ssl
}; };
}, },
@ -228,5 +228,10 @@ export default withFormik({
if (channels.length > 0) { if (channels.length > 0) {
join(channels, values.host); join(channels, values.host);
} }
localStorage.lastNick = values.nick;
if (values.realname) {
localStorage.lastRealname = values.realname;
}
} }
})(Connect); })(Connect);