Skip to content

Commit a3d6409

Browse files
committed
Remove clear history from non-public chats
1 parent 11d9a16 commit a3d6409

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed

src/status_im/group_chats/core.cljs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,12 @@
209209

210210
(fx/defn ui-leave-chat-pressed
211211
{:events [:group-chats.ui/leave-chat-pressed]}
212-
[_ chat-id]
213-
{:ui/show-confirmation
214-
{:title (i18n/label :t/leave-confirmation)
215-
:content (i18n/label :t/leave-chat-confirmation)
216-
:confirm-button-text (i18n/label :t/leave)
217-
:on-accept #(do
218-
(re-frame/dispatch [:bottom-sheet/hide])
219-
(re-frame/dispatch [:group-chats.ui/leave-chat-confirmed chat-id]))}})
212+
[{:keys [db]} chat-id]
213+
(let [chat-name (get-in db [:chats chat-id :name])]
214+
{:ui/show-confirmation
215+
{:title (i18n/label :t/leave-confirmation {:chat-name chat-name})
216+
:content (i18n/label :t/leave-chat-confirmation)
217+
:confirm-button-text (i18n/label :t/leave)
218+
:on-accept #(do
219+
(re-frame/dispatch [:bottom-sheet/hide])
220+
(re-frame/dispatch [:group-chats.ui/leave-chat-confirmed chat-id]))}}))

src/status_im/ui/screens/chat/sheets.cljs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@
3535
:accessibility-label :mark-all-read-button
3636
:icon :main-icons/check
3737
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]
38-
[quo/list-item
39-
{:theme :accent
40-
:title (i18n/label :t/clear-history)
41-
:accessibility-label :clear-history-button
42-
:icon :main-icons/close
43-
:on-press #(re-frame/dispatch [:chat.ui/clear-history-pressed chat-id])}]
4438
[quo/list-item
4539
{:theme :negative
4640
:title (i18n/label :t/delete-chat)
@@ -105,13 +99,7 @@
10599
:title (i18n/label :t/mark-all-read)
106100
:accessibility-label :mark-all-read-button
107101
:icon :main-icons/check
108-
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]
109-
[quo/list-item
110-
{:theme :accent
111-
:title (i18n/label :t/clear-history)
112-
:accessibility-label :clear-history-button
113-
:icon :main-icons/close
114-
:on-press #(re-frame/dispatch [:chat.ui/clear-history-pressed chat-id])}]]))
102+
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]]))
115103

116104
(defn group-chat-accents []
117105
(fn [{:keys [chat-id group-chat chat-name color invitation-admin]}]
@@ -141,12 +129,6 @@
141129
:accessibility-label :mark-all-read-button
142130
:icon :main-icons/check
143131
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]
144-
[quo/list-item
145-
{:theme :accent
146-
:title (i18n/label :t/clear-history)
147-
:accessibility-label :clear-history-button
148-
:icon :main-icons/close
149-
:on-press #(re-frame/dispatch [:chat.ui/clear-history-pressed chat-id])}]
150132
(when joined?
151133
[quo/list-item
152134
{:theme :negative

translations/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@
595595
"group-chat-name-changed": "**{{member}}** changed the group's name to **{{name}}**",
596596
"group-chat-no-contacts": "You don't have any contacts yet.\nInvite your friends to start chatting",
597597
"leave-chat":"Leave chat",
598-
"leave-confirmation": "Leave chat",
599-
"leave-chat-confirmation": "Are you sure you want to leave the chat?",
598+
"leave-confirmation": "Leave {{chat-name}}",
599+
"leave-chat-confirmation": "Chat history will be removed from your device. After rejoining you won't be able to retrieve any of your history.",
600600
"group-chat-all-contacts-invited": "All your contacts are already in the group",
601601
"group-info": "Group info",
602602
"gwei": "Gwei",

0 commit comments

Comments
 (0)