Skip to content

Commit

Permalink
fix: Fixed "'isGroup' of undefined" for group links (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Aug 4, 2021
1 parent c864a11 commit 255db87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/wapi/functions/get-group-invite-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

export async function getGroupInviteLink(chatId) {
var chat = Store.Chat.get(chatId);
if (!chat) {
throw {
error: true,
code: 'group_not_found',
message: 'Group not found',
};
}
if (!chat.isGroup) {
return '';
}
Expand Down
7 changes: 7 additions & 0 deletions src/lib/wapi/functions/revoke-invite-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

export async function revokeGroupInviteLink(chatId) {
var chat = Store.Chat.get(chatId);
if (!chat) {
throw {
error: true,
code: 'group_not_found',
message: 'Group not found',
};
}
if (!chat.isGroup) return false;
const inviteCode = await Store.GroupInvite.sendRevokeGroupInviteCode(chat.id);

Expand Down

0 comments on commit 255db87

Please sign in to comment.