Просмотр исходного кода

fix(ui): open tag entries externally when the user prefers it

The tag entry page predates the "Read articles by opening external
links" setting and never redirected to the article like the other
entry pages.
Frédéric Guillot 2 часов назад
Родитель
Сommit
c7d9a10133
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      internal/ui/entry_tag.go

+ 5 - 0
internal/ui/entry_tag.go

@@ -51,6 +51,11 @@ func (h *handler) showTagEntryPage(w http.ResponseWriter, r *http.Request) {
 		entry.Status = model.EntryStatusRead
 	}
 
+	if user.AlwaysOpenExternalLinks {
+		response.HTMLRedirect(w, r, entry.URL)
+		return
+	}
+
 	prevEntry, nextEntry, err := h.store.NewEntryPaginationBuilder(user.ID, entry.ID, user.EntryOrder, user.EntryDirection).
 		WithTags([]string{tagName}).
 		Entries()