diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-07-18 22:30:05 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-07-18 22:30:05 -0700 |
commit | a291d8a38b40569fdd1f00125ca0b29e4b9264f2 (patch) | |
tree | 13345ce7b413d9919521de258e60954467afcda0 /ui/session/session.go | |
parent | c1ab27172c0d82f9289aeb3402056f727bc473fd (diff) |
Improve themes handling
- Store user theme in session
- Logged out users will keep their theme
- Add theme background color to web manifest and meta tag
Diffstat (limited to 'ui/session/session.go')
-rw-r--r-- | ui/session/session.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/session/session.go b/ui/session/session.go index 3d630a8..474bd18 100644 --- a/ui/session/session.go +++ b/ui/session/session.go @@ -51,11 +51,16 @@ func (s *Session) FlashErrorMessage() string { return message } -// SetLanguage updates language field in session. +// SetLanguage updates the language field in session. func (s *Session) SetLanguage(language string) { s.store.UpdateSessionField(s.ctx.SessionID(), "language", language) } +// SetTheme updates the theme field in session. +func (s *Session) SetTheme(theme string) { + s.store.UpdateSessionField(s.ctx.SessionID(), "theme", theme) +} + // SetPocketRequestToken updates Pocket Request Token. func (s *Session) SetPocketRequestToken(requestToken string) { s.store.UpdateSessionField(s.ctx.SessionID(), "pocket_request_token", requestToken) |