Skip to content

Commit

Permalink
fixup! WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
cammellos committed May 25, 2020
1 parent 9b3d210 commit 6e65a59
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 41 deletions.
6 changes: 2 additions & 4 deletions src/status_im/subs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
[status-im.utils.money :as money]
[status-im.utils.platform :as platform]
[status-im.utils.security :as security]
[status-im.utils.universal-links.core :as links]
[status-im.wallet.db :as wallet.db]
[status-im.wallet.utils :as wallet.utils]
status-im.ui.screens.keycard.subs
Expand Down Expand Up @@ -636,9 +635,8 @@
:chats/current-chat
:<- [:chats/current-raw-chat]
:<- [:multiaccount/public-key]
:<- [:mailserver/ranges]
(fn [[{:keys [group-chat chat-id messages] :as current-chat}
my-public-key ranges]]
(fn [[{:keys [group-chat] :as current-chat}
my-public-key]]
(when current-chat
(cond-> current-chat
(chat.models/public-chat? current-chat)
Expand Down
3 changes: 1 addition & 2 deletions src/status_im/ui/screens/chat/group.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
{:group-name chat-name})]))))

(defn group-chat-description-container
[{:keys [chat-name
public?
[{:keys [public?
chat-id
loading-messages?
no-messages?]}]
Expand Down
13 changes: 1 addition & 12 deletions src/status_im/ui/screens/chat/toolbar_content.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@
[status-im.ui.screens.chat.styles.main :as st])
(:require-macros [status-im.utils.views :refer [defview letsubs]]))

(defn- in-progress-text [{:keys [highestBlock currentBlock startBlock]}]
(let [total (- highestBlock startBlock)
ready (- currentBlock startBlock)
percentage (if (zero? ready)
0
(->> (/ ready total)
(* 100)
(.round js/Math)))]

(str (i18n/label :t/sync-in-progress) " " percentage "% " currentBlock)))

(defn- group-last-activity [{:keys [contacts public?]}]
[react/view {:flex-direction :row}
[react/text {:style st/toolbar-subtitle}
Expand Down Expand Up @@ -51,6 +40,6 @@
chat-name]
(when contact
[contact-indicator contact])
(if group-chat
(when group-chat
[group-last-activity {:contacts contacts
:public? public?}])]]))
43 changes: 20 additions & 23 deletions src/status_im/ui/screens/chat/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,28 @@

(defn chat-intro-header-container
[{:keys [group-chat
chat-name
might-have-join-time-messages?
name pending-invite-inviter-name color chat-id chat-name
public? contact intro-status] :as chat}
name color chat-id chat-name
public? contact]}
no-messages]
(let [icon-text (if public? chat-id name)
intro-name (if public? chat-name (multiaccounts/displayed-name contact))]
[react/touchable-without-feedback
{:style {:flex 1
:align-items :flex-start}
:on-press (fn [_]
(re-frame/dispatch
[:chat.ui/set-chat-ui-props {:input-bottom-sheet nil}])
(react/dismiss-keyboard!))}
(let [opts
{:chat-id chat-id
:group-chat group-chat
:chat-name chat-name
:public? public?
:color color
:loading-messages? might-have-join-time-messages?
:no-messages? no-messages}]
(if group-chat
[chat-intro opts]
[chat-intro-one-to-one opts]))]))
[react/touchable-without-feedback
{:style {:flex 1
:align-items :flex-start}
:on-press (fn [_]
(re-frame/dispatch
[:chat.ui/set-chat-ui-props {:input-bottom-sheet nil}])
(react/dismiss-keyboard!))}
(let [opts
{:chat-id chat-id
:group-chat group-chat
:chat-name chat-name
:public? public?
:color color
:loading-messages? might-have-join-time-messages?
:no-messages? no-messages}]
(if group-chat
[chat-intro opts]
[chat-intro-one-to-one opts]))])

(defonce messages-list-ref (atom nil))

Expand Down

0 comments on commit 6e65a59

Please sign in to comment.