[#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
d7cc6aa90a
commit
81a2069d6a
|
@ -227,7 +227,7 @@
|
|||
|
||||
(fx/defn handle-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)))]
|
||||
{:db (assoc-in db [:chats chat-id] chat)
|
||||
:dispatch [:chat.ui/navigate-to-chat chat-id]}))
|
||||
|
@ -235,10 +235,8 @@
|
|||
(fx/defn navigate-to-user-pinned-messages
|
||||
"Takes coeffects map and chat-id, returns effects necessary for navigation and preloading data"
|
||||
{:events [:chat.ui/navigate-to-pinned-messages]}
|
||||
[{db :db :as cofx} chat-id]
|
||||
(fx/merge cofx
|
||||
{:db (assoc db :current-chat-id chat-id)}
|
||||
(navigation/navigate-to :chat-pinned-messages nil)))
|
||||
[cofx chat-id]
|
||||
(navigation/navigate-to cofx :chat-pinned-messages {:chat-id chat-id}))
|
||||
|
||||
(fx/defn start-chat
|
||||
"Start a chat, making sure it exists"
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
[status-im.ui.screens.chat.views :as chat]
|
||||
[status-im.ui.components.list.views :as list]))
|
||||
|
||||
(defn pins-topbar []
|
||||
(let [{:keys [group-chat chat-id chat-name]}
|
||||
@(re-frame/subscribe [:chats/current-chat])
|
||||
(defn pins-topbar [chat]
|
||||
(let [{:keys [group-chat chat-id chat-name]} chat
|
||||
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]))]
|
||||
[topbar/topbar {:show-border? true
|
||||
|
@ -78,18 +77,20 @@
|
|||
:padding-bottom 16}})])))
|
||||
|
||||
(defn pinned-messages []
|
||||
(let [bottom-space (reagent/atom 0)
|
||||
panel-space (reagent/atom 52)
|
||||
active-panel (reagent/atom nil)
|
||||
position-y (animated/value 0)
|
||||
pan-state (animated/value 0)
|
||||
text-input-ref (quo.react/create-ref)
|
||||
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)
|
||||
chat @(re-frame/subscribe [:chats/current-chat-chat-view])]
|
||||
[:<>
|
||||
[pins-topbar]
|
||||
[connectivity/loading-indicator]
|
||||
[pinned-messages-view {:chat chat
|
||||
:pan-responder pan-responder
|
||||
:space-keeper space-keeper}]]))
|
||||
(let [{:keys [chat-id]} @(re-frame/subscribe [:get-screen-params])]
|
||||
(fn []
|
||||
(let [bottom-space (reagent/atom 0)
|
||||
panel-space (reagent/atom 52)
|
||||
active-panel (reagent/atom nil)
|
||||
position-y (animated/value 0)
|
||||
pan-state (animated/value 0)
|
||||
text-input-ref (quo.react/create-ref)
|
||||
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)
|
||||
chat @(re-frame/subscribe [:chat-by-id chat-id])]
|
||||
[:<>
|
||||
[pins-topbar chat]
|
||||
[connectivity/loading-indicator]
|
||||
[pinned-messages-view {:chat chat
|
||||
:pan-responder pan-responder
|
||||
:space-keeper space-keeper}]]))))
|
|
@ -90,6 +90,7 @@
|
|||
:accessibility-label :profile-nickname-item
|
||||
:accessory :text
|
||||
:accessory-text pin-count
|
||||
:disabled (zero? pin-count)
|
||||
:on-press #(re-frame/dispatch [:contact.ui/pinned-messages-pressed public-key])
|
||||
:chevron true}])
|
||||
|
||||
|
|
Loading…
Reference in New Issue