Fix empty state messages and feed status logicUnverified
076805f parent: 1e8c440 modified
internal/server/articles_handler.go +2 -0 | @@ -42,6 +42,8 @@ func (s *Server) handleArticles(w http.ResponseWriter, r *http.Request) { | ||
| 42 | 42 | unreadCount, _ := s.db.GetUnreadCount(r.Context(), user.DID, feedURL) |
| 43 | 43 | if unreadCount > 0 { |
| 44 | 44 | status = "unread" |
| 45 | + } else { | |
| 46 | + status = "all" | |
| 45 | 47 | } |
| 46 | 48 | } |
| 47 | 49 | |
| @@ -42,6 +42,8 @@ func (s *Server) handleArticles(w http.ResponseWriter, r *http.Request) { | |||
| 42 | unreadCount, _ := s.db.GetUnreadCount(r.Context(), user.DID, feedURL) | 42 | unreadCount, _ := s.db.GetUnreadCount(r.Context(), user.DID, feedURL) |
| 43 | if unreadCount > 0 { | 43 | if unreadCount > 0 { |
| 44 | status = "unread" | 44 | status = "unread" |
| 45 | + } else { | ||
| 46 | + status = "all" | ||
| 45 | } | 47 | } |
| 46 | } | 48 | } |
| 47 | 49 | ||
modified
internal/tmpl/profile.html +2 -2 | @@ -37,7 +37,7 @@ | ||
| 37 | 37 | <svg class="w-4 h-4 text-spot-muted shrink-0" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg> |
| 38 | 38 | </a> |
| 39 | 39 | {{else}} |
| 40 | - <div class="px-4 py-6 text-center text-spot-secondary text-sm">No public feeds.</div> | |
| 40 | + <div class="px-4 py-6 text-center text-spot-secondary text-sm">No feeds.</div> | |
| 41 | 41 | {{end}} |
| 42 | 42 | </div> |
| 43 | 43 | |
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | {{range .Annotations}} |
| 47 | 47 | {{template "annotation-card.html" dict "annotation" . "userDID" $.CurrentUserDID}} |
| 48 | 48 | {{else}} |
| 49 | - <p class="text-sm text-spot-secondary text-center py-4">No public annotations.</p> | |
| 49 | + <p class="text-sm text-spot-secondary text-center py-4">No annotations.</p> | |
| 50 | 50 | {{end}} |
| 51 | 51 | </div> |
| 52 | 52 | </div> |
| @@ -37,7 +37,7 @@ | |||
| 37 | <svg class="w-4 h-4 text-spot-muted shrink-0" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg> | 37 | <svg class="w-4 h-4 text-spot-muted shrink-0" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/></svg> |
| 38 | </a> | 38 | </a> |
| 39 | {{else}} | 39 | {{else}} |
| 40 | - <div class="px-4 py-6 text-center text-spot-secondary text-sm">No public feeds.</div> | 40 | + <div class="px-4 py-6 text-center text-spot-secondary text-sm">No feeds.</div> |
| 41 | {{end}} | 41 | {{end}} |
| 42 | </div> | 42 | </div> |
| 43 | 43 | ||
| @@ -46,7 +46,7 @@ | |||
| 46 | {{range .Annotations}} | 46 | {{range .Annotations}} |
| 47 | {{template "annotation-card.html" dict "annotation" . "userDID" $.CurrentUserDID}} | 47 | {{template "annotation-card.html" dict "annotation" . "userDID" $.CurrentUserDID}} |
| 48 | {{else}} | 48 | {{else}} |
| 49 | - <p class="text-sm text-spot-secondary text-center py-4">No public annotations.</p> | 49 | + <p class="text-sm text-spot-secondary text-center py-4">No annotations.</p> |
| 50 | {{end}} | 50 | {{end}} |
| 51 | </div> | 51 | </div> |
| 52 | </div> | 52 | </div> |