From 5203234c4af331343fb84024e7962f561d2d6973 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 17 Sep 2024 15:56:41 +0800 Subject: [PATCH] :bug: Fix bugs in updating notification preferences --- pkg/internal/services/preferences.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/internal/services/preferences.go b/pkg/internal/services/preferences.go index bd76c3e..cfb84c5 100644 --- a/pkg/internal/services/preferences.go +++ b/pkg/internal/services/preferences.go @@ -28,6 +28,10 @@ func UpdateNotificationPreference(account models.Account, config map[string]bool lo.MapValues(config, func(v bool, k string) any { return v }), ), } + } else { + notification.Config = datatypes.JSONMap( + lo.MapValues(config, func(v bool, k string) any { return v }), + ) } err = database.C.Save(¬ification).Error