Skip to content

Commit

Permalink
fix(293): group property 'find' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
joaosouz4dev committed Nov 6, 2020
1 parent 99f0f36 commit a661e1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/get-all-group-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNMMNNNMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
*/
export function getAllGroupMetadata(done) {
const groupData = window.Store.GroupMetadata.map(
(groupData) => groupData.all
const groupData = window.Store.GroupMetadata.default.map(
(groupData) => groupData.attributes
);

if (done !== undefined) done(groupData);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/get-group-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNMMNNNMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
*/
export async function getGroupMetadata(id, done) {
let output = window.Store.GroupMetadata.find(id);
let output = window.Store.GroupMetadata.default.find(id);
if (done !== undefined) done(output);
return output;
}
2 changes: 1 addition & 1 deletion src/lib/wapi/listeners/add-on-participants-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function addOnParticipantsChange() {
];
const chat = window.Store.Chat.get(groupId);
//attach all group Participants to the events object as 'add'
const metadata = window.Store.GroupMetadata.get(groupId);
const metadata = window.Store.GroupMetadata.default.get(groupId);
if (!groupParticpiantsEvents[groupId]) {
groupParticpiantsEvents[groupId] = {};
metadata.participants.forEach((participant) => {
Expand Down
5 changes: 5 additions & 0 deletions src/lib/wapi/store/store-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,9 @@ export const storeObjects = [
? module
: null,
},
{
id: 'GroupMetadata',
conditions: (module) =>
module.default && module.default.handlePendingInvite ? module : null,
},
];

2 comments on commit a661e1c

@joaosouz4dev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edgardmessias
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close #296

Please sign in to comment.