commit c12acc0

default  ·  2024-03-15 18:20:24 +0000 UTC
parent d50b039
Also hide Older... posts details if it's empty.
1 files changed,  +9, -1
M html.c
M html.c
+9, -1
 1@@ -1859,6 +1859,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
 2             xs_list *p = children;
 3             char *cmd5;
 4             int cnt = 0;
 5+            int o_cnt = 0;
 6 
 7             while (xs_list_iter(&p, &cmd5)) {
 8                 xs *chd = NULL;
 9@@ -1874,9 +1875,12 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
10                             level + 1, cmd5, hide_children);
11 
12                         if (che != NULL) {
13-                            if (left > 3)
14+                            if (left > 3) {
15                                 xs_html_add(ch_older,
16                                     che);
17+
18+                                o_cnt++;
19+                            }
20                             else
21                                 xs_html_add(ch_container,
22                                     che);
23@@ -1895,6 +1899,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
24             if (cnt == 0)
25                 xs_html_add(ch_details,
26                     xs_html_attr("style", "display: none"));
27+
28+            if (o_cnt == 0 && ch_older)
29+                xs_html_add(ch_older,
30+                    xs_html_attr("style", "display: none"));
31         }
32     }
33