Skip to content

Commit

Permalink
Merge pull request #2523 from SMe12435/master
Browse files Browse the repository at this point in the history
bugFix: promoteParticipant
  • Loading branch information
orkestral authored Nov 3, 2023
2 parents 49c00d7 + b78b420 commit 90e1aa4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/lib/wapi/functions/get-group-participant-ids.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export async function getGroupParticipantIDs(groupId, done) {
// const output = Promise.resolve(WAPI.group.getParticipants(groupId)).then(
// (participants) => participants.map((p) => p.toJSON())
// );
// if (done !== undefined) done(output);
// return output;
const output = Promise.resolve(WAPI.group.getParticipants(groupId)).then(
(participants) => participants.map((p) => p.toJSON())
);
if (done !== undefined) done(output);
return output;
}
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/promote-participant.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export async function promoteParticipant(groupId, contactsId, done) {
return false;
}

await window.Store.WapQuery.promoteParticipants(chat.id, contactsId);
// await window.Store.WapQuery.promoteParticipants(chat.id, contactsId);

const participants = contactsId.map((c) =>
chat.groupMetadata.participants.get(c)
);

await window.Store.Participants.promoteParticipants(chat, participants);
await Store.Participants.promoteParticipants(chat, participants);

typeof done === 'function' && done(true);
return true;
Expand Down

0 comments on commit 90e1aa4

Please sign in to comment.