[#12918] Show history gaps only in public chats and communities

This commit is contained in:
Roman Volosovskyi 2021-12-24 13:39:51 +02:00
parent de3c08ba18
commit 29a7e4dc1c
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 25 additions and 21 deletions

View File

@ -12,12 +12,13 @@
(re-frame/dispatch [:chat.ui/fill-gaps chat-id gap-ids])))
(views/defview gap
[{:keys [gap-ids chat-id gap-parameters]}]
[{:keys [gap-ids chat-id gap-parameters public? community?]}]
(views/letsubs [in-progress? [:chats/fetching-gap-in-progress?
gap-ids
chat-id]
connected? [:mailserver/connected?]
first-gap? (= gap-ids #{:first-gap})]
(when (or (not first-gap?) public? community?)
[react/view {:style (style/gap-container)}
[react/touchable-highlight
{:on-press (when (and connected? (not in-progress?))
@ -36,4 +37,4 @@
(str
"\n"
(i18n/label :t/load-messages-before
{:date date})))])])]]]))
{:date date})))])])]]])))

View File

@ -243,7 +243,8 @@
(defn render-fn [{:keys [outgoing type] :as message}
idx
_
{:keys [group-chat public? current-public-key space-keeper chat-id show-input? message-pin-enabled edit-enabled in-pinned-view?]}]
{:keys [group-chat public? community? current-public-key space-keeper
chat-id show-input? message-pin-enabled edit-enabled in-pinned-view?]}]
[react/view {:style (when (and platform/android? (not in-pinned-view?)) {:scaleY -1})}
(if (= type :datemark)
[message-datemark/chat-datemark (:value message)]
@ -255,6 +256,7 @@
:incoming-group (and group-chat (not outgoing))
:group-chat group-chat
:public? public?
:community? community?
:current-public-key current-public-key
:show-input? show-input?
:message-pin-enabled message-pin-enabled
@ -285,6 +287,7 @@
community-admin?))))]
{:group-chat group-chat
:public? public?
:community? (not (nil? community-id))
:current-public-key current-public-key
:space-keeper space-keeper
:chat-id chat-id