🐛 fix delete account when change name

This commit is contained in:
微凉
2021-11-17 15:21:51 +08:00
parent 69514668cc
commit e8d27a30b4
5 changed files with 15 additions and 7 deletions

View File

@ -67,8 +67,9 @@ func (c Cloud189) Items() []Item {
}
func (c Cloud189) Save(account *model.Account, old *model.Account) error {
if old != nil {
if old != nil && old.Name != account.Name {
delete(client189Map, old.Name)
model.DeleteAccountFromMap(old.Name)
}
if err := c.Login(account); err != nil {
account.Status = err.Error()