mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-09 21:38:45 +00:00
Add notification interval setting
It replaces the "Auto refresh notifications" checkbox
This commit is contained in:
parent
856fe9e8c7
commit
c3d90539e9
6 changed files with 56 additions and 44 deletions
|
@ -434,7 +434,7 @@ func (svc *service) ServeNotificationPage(c *model.Client, maxID string,
|
|||
}
|
||||
|
||||
commonData := svc.getCommonData(c, "notifications")
|
||||
commonData.AutoRefresh = c.Session.Settings.AutoRefreshNotifications
|
||||
commonData.RefreshInterval = c.Session.Settings.NotificationInterval
|
||||
commonData.Target = "main"
|
||||
commonData.Count = unreadCount
|
||||
data := &renderer.NotificationData{
|
||||
|
@ -932,6 +932,11 @@ func (svc *service) UnSubscribe(c *model.Client, id string) (err error) {
|
|||
}
|
||||
|
||||
func (svc *service) SaveSettings(c *model.Client, s *model.Settings) (err error) {
|
||||
switch s.NotificationInterval {
|
||||
case 0, 30, 60, 120, 300, 600:
|
||||
default:
|
||||
return errInvalidArgument
|
||||
}
|
||||
session, err := svc.sessionRepo.Get(c.Session.ID)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue