[#12294] "Unknown" if tap "Pinned messages" on user profile from public chat
Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
parent
5ff854c7c7
commit
06f0ee877b
|
@ -227,7 +227,7 @@
|
||||||
|
|
||||||
(fx/defn handle-one-to-one-chat-created
|
(fx/defn handle-one-to-one-chat-created
|
||||||
{:events [::one-to-one-chat-created]}
|
{:events [::one-to-one-chat-created]}
|
||||||
[{:keys [db] :as cofx} chat-id response]
|
[{:keys [db]} chat-id response]
|
||||||
(let [chat (chats-store/<-rpc (first (:chats response)))]
|
(let [chat (chats-store/<-rpc (first (:chats response)))]
|
||||||
{:db (assoc-in db [:chats chat-id] chat)
|
{:db (assoc-in db [:chats chat-id] chat)
|
||||||
:dispatch [:chat.ui/navigate-to-chat chat-id]}))
|
:dispatch [:chat.ui/navigate-to-chat chat-id]}))
|
||||||
|
@ -235,10 +235,8 @@
|
||||||
(fx/defn navigate-to-user-pinned-messages
|
(fx/defn navigate-to-user-pinned-messages
|
||||||
"Takes coeffects map and chat-id, returns effects necessary for navigation and preloading data"
|
"Takes coeffects map and chat-id, returns effects necessary for navigation and preloading data"
|
||||||
{:events [:chat.ui/navigate-to-pinned-messages]}
|
{:events [:chat.ui/navigate-to-pinned-messages]}
|
||||||
[{db :db :as cofx} chat-id]
|
[cofx chat-id]
|
||||||
(fx/merge cofx
|
(navigation/navigate-to cofx :chat-pinned-messages {:chat-id chat-id}))
|
||||||
{:db (assoc db :current-chat-id chat-id)}
|
|
||||||
(navigation/navigate-to :chat-pinned-messages nil)))
|
|
||||||
|
|
||||||
(fx/defn start-chat
|
(fx/defn start-chat
|
||||||
"Start a chat, making sure it exists"
|
"Start a chat, making sure it exists"
|
||||||
|
|
|
@ -13,9 +13,8 @@
|
||||||
[status-im.ui.screens.chat.views :as chat]
|
[status-im.ui.screens.chat.views :as chat]
|
||||||
[status-im.ui.components.list.views :as list]))
|
[status-im.ui.components.list.views :as list]))
|
||||||
|
|
||||||
(defn pins-topbar []
|
(defn pins-topbar [chat]
|
||||||
(let [{:keys [group-chat chat-id chat-name]}
|
(let [{:keys [group-chat chat-id chat-name]} chat
|
||||||
@(re-frame/subscribe [:chats/current-chat])
|
|
||||||
pinned-messages @(re-frame/subscribe [:chats/pinned chat-id])
|
pinned-messages @(re-frame/subscribe [:chats/pinned chat-id])
|
||||||
[first-name _] (when-not group-chat @(re-frame.core/subscribe [:contacts/contact-two-names-by-identity chat-id]))]
|
[first-name _] (when-not group-chat @(re-frame.core/subscribe [:contacts/contact-two-names-by-identity chat-id]))]
|
||||||
[topbar/topbar {:show-border? true
|
[topbar/topbar {:show-border? true
|
||||||
|
@ -78,6 +77,8 @@
|
||||||
:padding-bottom 16}})])))
|
:padding-bottom 16}})])))
|
||||||
|
|
||||||
(defn pinned-messages []
|
(defn pinned-messages []
|
||||||
|
(let [{:keys [chat-id]} @(re-frame/subscribe [:get-screen-params])]
|
||||||
|
(fn []
|
||||||
(let [bottom-space (reagent/atom 0)
|
(let [bottom-space (reagent/atom 0)
|
||||||
panel-space (reagent/atom 52)
|
panel-space (reagent/atom 52)
|
||||||
active-panel (reagent/atom nil)
|
active-panel (reagent/atom nil)
|
||||||
|
@ -86,10 +87,10 @@
|
||||||
text-input-ref (quo.react/create-ref)
|
text-input-ref (quo.react/create-ref)
|
||||||
pan-responder (accessory/create-pan-responder position-y pan-state)
|
pan-responder (accessory/create-pan-responder position-y pan-state)
|
||||||
space-keeper (get-space-keeper-ios bottom-space panel-space active-panel text-input-ref)
|
space-keeper (get-space-keeper-ios bottom-space panel-space active-panel text-input-ref)
|
||||||
chat @(re-frame/subscribe [:chats/current-chat-chat-view])]
|
chat @(re-frame/subscribe [:chat-by-id chat-id])]
|
||||||
[:<>
|
[:<>
|
||||||
[pins-topbar]
|
[pins-topbar chat]
|
||||||
[connectivity/loading-indicator]
|
[connectivity/loading-indicator]
|
||||||
[pinned-messages-view {:chat chat
|
[pinned-messages-view {:chat chat
|
||||||
:pan-responder pan-responder
|
:pan-responder pan-responder
|
||||||
:space-keeper space-keeper}]]))
|
:space-keeper space-keeper}]]))))
|
|
@ -90,6 +90,7 @@
|
||||||
:accessibility-label :profile-nickname-item
|
:accessibility-label :profile-nickname-item
|
||||||
:accessory :text
|
:accessory :text
|
||||||
:accessory-text pin-count
|
:accessory-text pin-count
|
||||||
|
:disabled (zero? pin-count)
|
||||||
:on-press #(re-frame/dispatch [:contact.ui/pinned-messages-pressed public-key])
|
:on-press #(re-frame/dispatch [:contact.ui/pinned-messages-pressed public-key])
|
||||||
:chevron true}])
|
:chevron true}])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue