From cfb676a453dadcbedc48cb96d4241d63a1206e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Thu, 5 Jun 2025 05:37:12 +0300 Subject: [PATCH] show subscribed threads in inbox even when there's no unreads --- apps/users.lua | 9 +++++++++ views/user/inbox.etlua | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/apps/users.lua b/apps/users.lua index 451511a..43620ac 100644 --- a/apps/users.lua +++ b/apps/users.lua @@ -298,6 +298,15 @@ app:get("user_inbox", "/:username/inbox", function(self) self.new_posts = {} local subscription = Subscriptions:find({user_id = me.id}) if subscription then + self.all_subscriptions = db.query([[ + SELECT threads.title AS thread_title, threads.slug AS thread_slug + FROM + threads + JOIN + subscriptions ON subscriptions.thread_id = threads.id + WHERE + subscriptions.user_id = ? + ]], me.id) local q = [[ WITH thread_metadata AS ( SELECT diff --git a/views/user/inbox.etlua b/views/user/inbox.etlua index 869343d..559d126 100644 --- a/views/user/inbox.etlua +++ b/views/user/inbox.etlua @@ -2,6 +2,21 @@

Inbox

+ <% if not all_subscriptions then %> + You have no subscriptions.
+ <% else %> + Your subscriptions: + + <% end %> <% if #new_posts == 0 then %> You have no unread posts. <% else %>