|
130 | 130 | :on-press #(hide-sheet-and-dispatch [:contact/block-contact |
131 | 131 | public-key])}])}])) |
132 | 132 |
|
133 | | -(defn mark-as-untrusted-action |
134 | | - [item] |
| 133 | +(defn handle-trust-mark-action |
| 134 | + [{:keys [public-key primary-name trust-status] :as item}] |
135 | 135 | (hide-sheet-and-dispatch |
136 | | - [:contact/mark-as-untrusted-sheet item])) |
137 | | - |
138 | | -(defn remove-untrusted-mark-action |
139 | | - [{:keys [public-key primary-name]}] |
140 | | - (hide-sheet-and-dispatch [:contact/remove-trust-status public-key primary-name])) |
| 136 | + (if (= trust-status |
| 137 | + constants/contact-trust-status-untrustworthy) |
| 138 | + [:contact/remove-trust-status public-key primary-name] |
| 139 | + [:contact/mark-as-untrusted-sheet item]))) |
141 | 140 |
|
142 | 141 | (defn mute-chat-entry |
143 | 142 | [chat-id chat-type muted-till] |
|
311 | 310 |
|
312 | 311 | (defn change-trust-status-entry |
313 | 312 | [{:keys [trust-status] :as item}] |
314 | | - (let [handle-press (if (= trust-status |
315 | | - constants/contact-trust-status-untrustworthy) |
316 | | - remove-untrusted-mark-action |
317 | | - mark-as-untrusted-action)] |
318 | | - (entry {:icon :i/untrustworthy |
319 | | - :label (i18n/label (if (= trust-status |
320 | | - constants/contact-trust-status-untrustworthy) |
321 | | - :t/remove-untrusted-mark |
322 | | - :t/mark-as-untrusted)) |
323 | | - :on-press #(handle-press item) |
324 | | - :danger? true |
325 | | - :add-divider? true |
326 | | - :accessibility-label :mark-as-untrusted |
327 | | - :sub-label nil |
328 | | - :chevron? false}))) |
| 313 | + (entry {:icon :i/untrustworthy |
| 314 | + :label (i18n/label (if (= trust-status |
| 315 | + constants/contact-trust-status-untrustworthy) |
| 316 | + :t/remove-untrusted-mark |
| 317 | + :t/mark-as-untrusted)) |
| 318 | + :on-press #(handle-trust-mark-action item) |
| 319 | + :danger? true |
| 320 | + :add-divider? true |
| 321 | + :accessibility-label :mark-as-untrusted |
| 322 | + :sub-label nil |
| 323 | + :chevron? false})) |
329 | 324 |
|
330 | 325 | (defn block-user-entry |
331 | 326 | [item] |
|
0 commit comments