1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-16 18:01:37 +00:00

fix(ui): reading preferences are reset if the form values are incorrect

This commit is contained in:
Frédéric Guillot 2025-01-12 16:11:15 -08:00
parent 6cbe8c3a9d
commit f5fde36d45
4 changed files with 16 additions and 11 deletions

View file

@ -63,8 +63,7 @@ func (h *handler) showSettingsPage(w http.ResponseWriter, r *http.Request) {
sess := session.New(h.store, request.SessionID(r))
view := view.New(h.tpl, r, sess)
view.Set("form", settingsForm)
// In order to keep the continuity between form and model, I pass adhoc constants to the view
view.Set("const", map[string]interface{}{
view.Set("readBehaviors", map[string]any{
"NoAutoMarkAsRead": form.NoAutoMarkAsRead,
"MarkAsReadOnView": form.MarkAsReadOnView,
"MarkAsReadOnViewButWaitForPlayerCompletion": form.MarkAsReadOnViewButWaitForPlayerCompletion,