Admin cannot re-add users to the group chat after removing them using the "Manage members" option. #20959 (#21082)

Incorrect text for system message when removing a User from a group chat #21053
This commit is contained in:
flexsurfer 2024-08-29 21:19:17 +02:00 committed by GitHub
parent 8948904a9b
commit b38d2c1836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 10 deletions

View File

@ -85,11 +85,12 @@
(rf/defn add-members
"Add members to a group chat"
{:events [:group-chats.ui/add-members-pressed]}
[{{:group-chat/keys [selected-participants]} :db :as cofx} chat-id]
{:json-rpc/call [{:method "wakuext_addMembersToGroupChat"
:params [nil chat-id selected-participants]
:js-response true
:on-success #(re-frame/dispatch [:chat-updated % true])}]})
[{{:group-chat/keys [selected-participants]} :db} chat-id]
(when (seq selected-participants)
{:json-rpc/call [{:method "wakuext_addMembersToGroupChat"
:params [nil chat-id selected-participants]
:js-response true
:on-success #(re-frame/dispatch [:chat-updated % true])}]}))
(rf/defn add-members-from-invitation
"Add members to a group chat"

View File

@ -58,6 +58,9 @@
{:keys [admins] :as group} (rf/sub [:chats/chat-by-id chat-id])
current-pk (rf/sub [:multiaccount/public-key])
admin? (get admins current-pk)]
(rn/use-mount (fn []
(rf/dispatch [:group/clear-added-participants])
(rf/dispatch [:group/clear-removed-members])))
[rn/view {:flex 1 :margin-top 20}
[rn/touchable-opacity
{:on-press #(rf/dispatch [:navigate-back])
@ -174,11 +177,8 @@
:icon :i/add-user
:label (i18n/label (if admin? :t/manage-members :t/add-members))
:counter-value (count contacts)
:on-press (fn []
(rf/dispatch [:group/clear-added-participants])
(rf/dispatch [:group/clear-removed-members])
(rf/dispatch [:open-modal :group-add-manage-members
chat-id]))}]}]
:on-press #(rf/dispatch [:open-modal :group-add-manage-members
chat-id])}]}]
[rn/section-list
{:key-fn :title
:sticky-section-headers-enabled false