Saving last nickname change within the server
This commit is contained in:
parent
1cf166eefb
commit
e9bae1ee0c
3 changed files with 7 additions and 2 deletions
|
@ -509,7 +509,7 @@ class ConnectionHandler {
|
||||||
console.log(tr("Allowed to auto reconnect. Reconnecting in 5000ms"));
|
console.log(tr("Allowed to auto reconnect. Reconnecting in 5000ms"));
|
||||||
const server_address = this.serverConnection.remote_address();
|
const server_address = this.serverConnection.remote_address();
|
||||||
const profile = this.serverConnection.handshake_handler().profile;
|
const profile = this.serverConnection.handshake_handler().profile;
|
||||||
const name = this.serverConnection.handshake_handler().name;
|
const name = this.getClient().clientNickName();
|
||||||
const password = this.serverConnection.handshake_handler().server_password;
|
const password = this.serverConnection.handshake_handler().server_password;
|
||||||
|
|
||||||
this._reconnect_timer = setTimeout(() => {
|
this._reconnect_timer = setTimeout(() => {
|
||||||
|
|
|
@ -901,6 +901,7 @@ class LocalClientEntry extends ClientEntry {
|
||||||
|
|
||||||
elm.text(_self.clientNickName());
|
elm.text(_self.clientNickName());
|
||||||
_self.handle.serverConnection.command_helper.updateClient("client_nickname", text).then((e) => {
|
_self.handle.serverConnection.command_helper.updateClient("client_nickname", text).then((e) => {
|
||||||
|
settings.changeGlobal(Settings.KEY_CONNECT_USERNAME, text);
|
||||||
this.channelTree.client.chat.serverChat().appendMessage(tr("Nickname successfully changed"));
|
this.channelTree.client.chat.serverChat().appendMessage(tr("Nickname successfully changed"));
|
||||||
}).catch((e: CommandResult) => {
|
}).catch((e: CommandResult) => {
|
||||||
this.channelTree.client.chat.serverChat().appendError(tr("Could not change nickname ({})"), e.extra_message);
|
this.channelTree.client.chat.serverChat().appendError(tr("Could not change nickname ({})"), e.extra_message);
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Modals {
|
||||||
let updateFields = function () {
|
let updateFields = function () {
|
||||||
console.log("Updating");
|
console.log("Updating");
|
||||||
if(selected_profile)
|
if(selected_profile)
|
||||||
input_nickname.attr("placeholder", selected_profile.default_username);
|
input_nickname.attr("placeholder", settings.static_global(Settings.KEY_CONNECT_USERNAME, selected_profile.default_username));
|
||||||
else
|
else
|
||||||
input_nickname.attr("placeholder", "");
|
input_nickname.attr("placeholder", "");
|
||||||
|
|
||||||
|
@ -77,6 +77,10 @@ namespace Modals {
|
||||||
|
|
||||||
input_profile.on('change', event => {
|
input_profile.on('change', event => {
|
||||||
selected_profile = profiles.find_profile(input_profile.val() as string);
|
selected_profile = profiles.find_profile(input_profile.val() as string);
|
||||||
|
{
|
||||||
|
settings.changeGlobal(Settings.KEY_CONNECT_USERNAME, selected_profile.default_username);
|
||||||
|
input_nickname.val(selected_profile.default_username);
|
||||||
|
}
|
||||||
input_profile.toggleClass("is-invalid", !selected_profile || !selected_profile.valid());
|
input_profile.toggleClass("is-invalid", !selected_profile || !selected_profile.valid());
|
||||||
updateFields();
|
updateFields();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue