mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Refactor Batch Builder and prevent accidental and excessive refreshes from the web ui
This commit is contained in:
parent
95ee1c423b
commit
4cc99881d8
32 changed files with 251 additions and 176 deletions
|
@ -4,6 +4,8 @@
|
|||
package session // import "miniflux.app/v2/internal/ui/session"
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"miniflux.app/v2/internal/storage"
|
||||
)
|
||||
|
||||
|
@ -13,6 +15,15 @@ type Session struct {
|
|||
sessionID string
|
||||
}
|
||||
|
||||
// New returns a new session handler.
|
||||
func New(store *storage.Storage, sessionID string) *Session {
|
||||
return &Session{store, sessionID}
|
||||
}
|
||||
|
||||
func (s *Session) SetLastForceRefresh() {
|
||||
s.store.UpdateAppSessionField(s.sessionID, "last_force_refresh", time.Now().UTC().Unix())
|
||||
}
|
||||
|
||||
func (s *Session) SetOAuth2State(state string) {
|
||||
s.store.UpdateAppSessionField(s.sessionID, "oauth2_state", state)
|
||||
}
|
||||
|
@ -61,8 +72,3 @@ func (s *Session) SetTheme(theme string) {
|
|||
func (s *Session) SetPocketRequestToken(requestToken string) {
|
||||
s.store.UpdateAppSessionField(s.sessionID, "pocket_request_token", requestToken)
|
||||
}
|
||||
|
||||
// New returns a new session handler.
|
||||
func New(store *storage.Storage, sessionID string) *Session {
|
||||
return &Session{store, sessionID}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue