Merge pull request #2350 from Wolfsblvt/fix-group-disable

Fix /member-disable wrongfully stacking
This commit is contained in:
Cohee 2024-06-05 00:02:07 +03:00 committed by GitHub
commit 6bed373f0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -1501,15 +1501,17 @@ async function onGroupActionClick(event) {
const index = _thisGroup.disabled_members.indexOf(member.data('id'));
if (index !== -1) {
_thisGroup.disabled_members.splice(index, 1);
await editGroup(openGroupId, false, false);
}
await editGroup(openGroupId, false, false);
}
if (action === 'disable') {
member.addClass('disabled');
const _thisGroup = groups.find(x => x.id === openGroupId);
_thisGroup.disabled_members.push(member.data('id'));
await editGroup(openGroupId, false, false);
if (!_thisGroup.disabled_members.includes(member.data('id'))) {
_thisGroup.disabled_members.push(member.data('id'));
await editGroup(openGroupId, false, false);
}
}
if (action === 'up' || action === 'down') {