Skip to content

Commit

Permalink
feat: set user.config if null
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Jul 29, 2024
1 parent 15e1a4b commit 252f07a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ func (user *User) LoadUserByID(userID int) error {
modified = true
}

if user.Config.Notify == nil {
user.Config.Notify = defaultUserConfig.Notify
modified = true
}

if modified {
err = tx.Select("BanDivision", "Config").Save(&user).Error
if err != nil {
Expand Down

0 comments on commit 252f07a

Please sign in to comment.