fix: set preferred username

This commit is contained in:
Richard Ramos 2021-09-14 15:50:56 -04:00 committed by Iuri Matias
parent 93aa7e6ae7
commit 8e80497cdc
1 changed files with 3 additions and 0 deletions

View File

@ -156,6 +156,9 @@ QtObject:
proc connect(self: EnsManager, ensUsername: string) =
var usernames = getSetting[seq[string]](self.status.settings, Setting.Usernames, @[])
if usernames.len == 0:
self.setPreferredUsername(ensUsername)
usernames.add ensUsername
discard self.status.settings.saveSetting(Setting.Usernames, %*usernames)