🐛 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

@ -273,7 +273,9 @@ func (o Onedrive) Save(account *model.Account, old *model.Account) error {
}
if old != nil {
conf.Cron.Remove(cron.EntryID(old.CronId))
model.DeleteAccountFromMap(old.Name)
if old.Name != account.Name {
model.DeleteAccountFromMap(old.Name)
}
}
account.RootFolder = utils.ParsePath(account.RootFolder)
err := o.RefreshToken(account)