🐛 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

@ -349,7 +349,9 @@ func (a AliDrive) RefreshToken(account *model.Account) error {
func (a AliDrive) 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)
}
}
if account.RootFolder == "" {
account.RootFolder = "root"