diff --git a/src/status_im/network/core.cljs b/src/status_im/network/core.cljs index 35e304acec..b65a01f959 100644 --- a/src/status_im/network/core.cljs +++ b/src/status_im/network/core.cljs @@ -207,6 +207,7 @@ (fx/defn handle-connection-status-change [{:keys [db] :as cofx} is-connected?] + (println "ChANGED" is-connected?) (fx/merge cofx {:db (assoc db :network-status (if is-connected? :online :offline))} (mailserver/network-connection-status-changed is-connected?))) diff --git a/src/status_im/ui/components/popup_menu/views.cljs b/src/status_im/ui/components/popup_menu/views.cljs index 1f35fcfcec..a3c7428c5c 100644 --- a/src/status_im/ui/components/popup_menu/views.cljs +++ b/src/status_im/ui/components/popup_menu/views.cljs @@ -26,3 +26,8 @@ chat-id])}] (remove nil?))) +(defn get-message-menu-items [chat-id message-id] + [{:text (i18n/label :t/resend-message) + :on-select #(re-frame/dispatch [:chat.ui/resend-message chat-id message-id])} + {:text (i18n/label :t/delete-message) + :on-select #(re-frame/dispatch [:chat.ui/delete-message chat-id message-id])}]) diff --git a/src/status_im/ui/screens/chat/message/message.cljs b/src/status_im/ui/screens/chat/message/message.cljs index b31efe7ea9..182146bae7 100644 --- a/src/status_im/ui/screens/chat/message/message.cljs +++ b/src/status_im/ui/screens/chat/message/message.cljs @@ -9,6 +9,7 @@ [status-im.chat.commands.receiving :as commands-receiving] [status-im.ui.screens.chat.styles.message.message :as style] [status-im.ui.screens.chat.photos :as photos] + [status-im.ui.components.popup-menu.views :as desktop.pop-up] [status-im.constants :as constants] [status-im.ui.screens.chat.utils :as chat.utils] [status-im.utils.identicon :as identicon] @@ -180,24 +181,29 @@ [react/activity-indicator {:animating true}]]) (defn message-not-sent-text [chat-id message-id] - [react/touchable-highlight {:on-press (fn [] (if platform/ios? + [react/touchable-highlight {:on-press (fn [] (cond + platform/ios? (action-sheet/show {:title (i18n/label :message-not-sent) :options [{:label (i18n/label :resend-message) :action #(re-frame/dispatch [:chat.ui/resend-message chat-id message-id])} {:label (i18n/label :delete-message) :destructive? true :action #(re-frame/dispatch [:chat.ui/delete-message chat-id message-id])}]}) + platform/desktop? + (desktop.pop-up/show-desktop-menu + (desktop.pop-up/get-message-menu-items chat-id message-id)) + + :else (re-frame/dispatch [:chat.ui/show-message-options {:chat-id chat-id :message-id message-id}])))} [react/view style/not-sent-view [react/text {:style style/not-sent-text} (i18n/message-status-label (if platform/desktop? - :not-sent-without-tap - :not-sent))] - (when-not platform/desktop? - [react/view style/not-sent-icon - [vector-icons/icon :icons/warning {:color colors/red}]])]]) + :not-sent-click + :not-sent-tap))] + [react/view style/not-sent-icon + [vector-icons/icon :icons/warning {:color colors/red}]]]]) (defview command-status [{{:keys [network]} :params}] (letsubs [current-network [:network-name]] diff --git a/translations/en.json b/translations/en.json index a0da604b5e..de77cd873c 100644 --- a/translations/en.json +++ b/translations/en.json @@ -252,8 +252,8 @@ "start-chat": "Start chat", "wallet-onboarding-title": "Simple and secure cryptocurrency wallet", "logout": "Log out", - "status-not-sent": "Not confirmed. Tap for options", - "status-not-sent-without-tap": "Not confirmed", + "status-not-sent-tap": "Not confirmed. Tap for options", + "status-not-sent-click": "Not confirmed. Click for options", "edit-network-config": "Edit network config", "clear-history-confirmation": "Clear history?", "connect": "Connect",