rnn more issues

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2021-06-29 13:33:46 +02:00
parent 35845ae3d3
commit b280befe2d
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
14 changed files with 174 additions and 158 deletions

View File

@ -26,7 +26,8 @@
;setting pin-retry-counter is a workaround for the way the PIN view decides if it should accept PUK or PIN
(assoc-in [:keycard :application-info :pin-retry-counter] 3)
(assoc-in [:keycard :factory-reset-card?] true)
(dissoc :popover/popover))}
(dissoc :popover/popover))
:hide-popover nil}
(signing.core/discard)
(if show-warning
(utils/show-confirmation {:title (i18n/label :t/keycard-recover-title)

View File

@ -64,7 +64,8 @@
(update-in [:keycard :pin] assoc
:enter-step :reset
:error nil
:status nil))})
:status nil))
:hide-popover nil})
(when-not (:multiaccounts/login db)
(navigation/navigate-to-cofx :keycard-pin nil))))
@ -73,7 +74,8 @@
[{:keys [db]}]
{:db (-> db
(dissoc :popover/popover)
(update :keycard dissoc :setup-step))})
(update :keycard dissoc :setup-step))
:hide-popover nil})
(fx/defn login-with-keycard
{:events [:keycard/login-with-keycard]}

View File

@ -105,6 +105,13 @@
(when-let [handler (get-in views/screens [(keyword id) :right-handler])]
(handler)))))))
(defn set-view-id [view-id]
(when-let [{:keys [on-focus]} (get views/screens view-id)]
(re-frame/dispatch [:set :view-id view-id])
(re-frame/dispatch [:screens/on-will-focus view-id])
(when on-focus
(re-frame/dispatch on-focus))))
(defonce register-modal-reg
(.registerModalDismissedListener
(.events Navigation)
@ -112,11 +119,11 @@
(if (> (count @modals) 1)
(let [new-modals (butlast @modals)]
(reset! modals (vec new-modals))
(re-frame/dispatch [:set :view-id (last new-modals)]))
(set-view-id (last new-modals)))
(do
(reset! modals [])
(reset! curr-modal false)
(re-frame/dispatch [:set :view-id @pushed-screen-id])))
(set-view-id @pushed-screen-id)))
(let [comp @dissmissing]
(reset! dissmissing false)
@ -129,12 +136,9 @@
(.events Navigation)
(fn [^js evn]
(let [view-id (keyword (.-componentName evn))]
(when-let [{:keys [on-focus]} (get views/screens view-id)]
(when (get views/screens view-id)
(when (and (not= view-id :bottom-sheet) (not= view-id :popover))
(re-frame/dispatch [:set :view-id view-id])
(re-frame/dispatch [:screens/on-will-focus view-id])
(when on-focus
(re-frame/dispatch on-focus))
(set-view-id view-id)
(when-not @curr-modal
(reset! pushed-screen-id view-id))))))))

View File

@ -386,7 +386,8 @@
(fx/merge cofx
{:db (-> db
(assoc-in [:keycard :pin :status] nil)
(dissoc :signing/tx :signing/sign))}
(dissoc :signing/tx :signing/sign))
:hide-signing-sheet nil}
(check-queue)
(keycard.common/hide-connection-sheet)
(keycard.common/clear-pin)

View File

@ -14,5 +14,5 @@
20)]
(reagent/as-element
(into [react/keyboard-avoiding-view (update props :keyboardVerticalOffset
+ vertical-offset)]
+ vertical-offset (if (:ignore-offset props) 44 0))]
children))))]))

View File

@ -325,7 +325,7 @@
on-close #(set-active-panel nil)]
(reagent/create-class
{:component-will-unmount #(re-frame/dispatch-sync [:close-chat curr-chat-id])
:component-did-mount (fn [] (js/setTimeout #(re-frame/dispatch [:set :ignore-close-chat false]) 1000))
:component-did-mount (fn [] (js/setTimeout #(re-frame/dispatch [:set :ignore-close-chat false]) 500))
:reagent-render
(fn []
(let [{:keys [chat-id show-input? group-chat admins invitation-admin] :as chat}

View File

@ -7,8 +7,9 @@
[status-im.communities.core :as communities]))
(defn view []
(let [{:keys [chat-id]} (<sub [:get-screen-params])
current-chat (<sub [:chat-by-id chat-id])
(let [{:keys [chat-id]} (<sub [:get-screen-params])]
(fn []
(let [current-chat (<sub [:chat-by-id chat-id])
{:keys [chat-name color description community-id]} current-chat
{:keys [admin]} (<sub [:communities/community community-id])]
[:<>
@ -31,4 +32,4 @@
[:<>
[quo/list-footer {:color :main}
description]
[quo/separator {:style {:margin-vertical 8}}]])]]))
[quo/separator {:style {:margin-vertical 8}}]])]]))))

View File

@ -128,6 +128,7 @@
;; unread indicator
(assoc home-item :public? true)
{:on-press (fn []
(re-frame/dispatch [:pop-to-root-tab :chat-stack])
(re-frame/dispatch [:dismiss-keyboard])
(re-frame/dispatch [:chat.ui/navigate-to-chat chat-id])
(re-frame/dispatch [:search/home-filter-changed nil]))

View File

@ -41,10 +41,10 @@
(defn invite []
(let [user-pk (reagent/atom "")
contacts-selected (reagent/atom #{})]
contacts-selected (reagent/atom #{})
{:keys [invite?]} (<sub [:get-screen-params])]
(fn []
(let [contacts-data (<sub [:contacts/active])
{:keys [invite?]} (<sub [:get-screen-params])
{:keys [permissions
can-manage-users?]} (<sub [:communities/edited-community])
selected @contacts-selected

View File

@ -86,8 +86,9 @@
[quo/separator {:style {:margin-vertical 8}}]]))
(defn members []
(let [{:keys [community-id]} (<sub [:get-screen-params])
my-public-key (<sub [:multiaccount/public-key])
(let [{:keys [community-id]} (<sub [:get-screen-params])]
(fn []
(let [my-public-key (<sub [:multiaccount/public-key])
{:keys [members
permissions
can-manage-users?]} (<sub [:communities/community community-id])]
@ -106,7 +107,7 @@
constants/community-no-membership-access))
:can-manage-users? can-manage-users?}
:key-fn identity
:render-fn render-member}]]))
:render-fn render-member}]]))))
(defn members-container []
(reagent/create-class

View File

@ -15,8 +15,9 @@
[clojure.string :as string]))
(defn management []
(let [{:keys [community-id]} (<sub [:get-screen-params])
requests-to-join (<sub [:communities/requests-to-join-for-community community-id])
(let [{:keys [community-id]} (<sub [:get-screen-params])]
(fn []
(let [requests-to-join (<sub [:communities/requests-to-join-for-community community-id])
community (<sub [:communities/community community-id])
{:keys [color members permissions description name admin]} community
roles false
@ -96,7 +97,7 @@
[quo/list-item {:theme :negative
:icon :main-icons/delete
:title (i18n/label :t/delete)
:on-press #(>evt [::communities/delete-community community-id])}])]]]))
:on-press #(>evt [::communities/delete-community community-id])}])]]]))))
(defn management-container []
(reagent/create-class

View File

@ -43,9 +43,9 @@
(multiaccounts/displayed-photo member)]}]))
(defn requests-to-join []
(let [{:keys [community-id]} (<sub [:get-screen-params])]
(fn []
(let [{:keys [community-id]} (<sub [:get-screen-params])
requests (<sub [:communities/requests-to-join-for-community community-id])
(let [requests (<sub [:communities/requests-to-join-for-community community-id])
{:keys [can-manage-users?]} (<sub [:communities/community community-id])]
[:<>
[topbar/topbar {:title (i18n/label :t/community-requests-to-join-title)
@ -54,7 +54,7 @@
:render-data {:community-id community-id
:can-manage-users? can-manage-users?}
:key-fn :id
:render-fn render-request}]])))
:render-fn render-request}]]))))
(defn requests-to-join-container []
(reagent/create-class

View File

@ -116,7 +116,8 @@
(defn nickname-view [public-key {:keys [nickname ens-name three-words-name]}]
(let [entered-nickname (reagent/atom nickname)]
(fn []
[kb-presentation/keyboard-avoiding-view {:style {:flex 1}}
[kb-presentation/keyboard-avoiding-view {:style {:flex 1}
:ignore-offset true}
[topbar/topbar {:title (i18n/label :t/nickname)
:subtitle (or ens-name three-words-name)
:modal? true}]
@ -202,6 +203,7 @@
:ref #(reset! status.views/messages-list-ref %)
:on-end-reached #(re-frame/dispatch [:chat.ui/load-more-messages current-chat-id])
:on-scroll-to-index-failed #() ;;don't remove this
:render-data {:chat-id current-chat-id}
:render-data {:chat-id current-chat-id
:profile true}
:render-fn status.views/render-message
:data messages}]])))

View File

@ -98,7 +98,7 @@
:on-long-press #(on-long-press-fn on-long-press content true)}
[message-content-image (:image content) false]]])))
(defn message-item [account]
(defn message-item [account profile]
(fn [{:keys [content-type content from timestamp outgoing] :as message}
{:keys [modal on-long-press close-modal]}]
[react/view (merge {:padding-vertical 8
@ -109,6 +109,7 @@
{:border-radius 16}))
[react/touchable-highlight
{:on-press #(do (when modal (close-modal))
(when profile (re-frame/dispatch [:navigate-back]))
(re-frame/dispatch [:chat.ui/show-profile from]))}
[react/view {:padding-top 2 :padding-right 8}
(if outgoing
@ -119,6 +120,7 @@
:justify-content :space-between}
[react/touchable-highlight
{:on-press #(do (when modal (close-modal))
(when profile (re-frame/dispatch [:navigate-back]))
(re-frame/dispatch [:chat.ui/show-profile from]))}
(if outgoing
[message/message-my-name {:profile? true :you? false}]
@ -133,7 +135,7 @@
[message/render-parsed-text (assoc message :outgoing false) (:parsed-text content)]])
[link-preview/link-preview-wrapper (:links content) outgoing true]]]]))
(defn render-message [{:keys [type] :as message} idx _ {:keys [timeline account chat-id]}]
(defn render-message [{:keys [type] :as message} idx _ {:keys [timeline account chat-id profile]}]
(if (= type :datemark)
nil
(if (= type :gap)
@ -165,7 +167,7 @@
:chat-id chat-id
:emoji-id emoji-id
:emoji-reaction-id emoji-reaction-id}]))
:render (message-item account)}]]))))
:render (message-item account profile)}]]))))
(def state (reagent/atom {:tab :timeline}))