I was trying to fetch the groups metadata like
WAPI.getGroupMetadata('[email protected]', (done) => console.log(done));
but the getGroupMetadata is throwing the below error
Promise聽{<rejected>: TypeError: output.update is not a function
at Object../chrome/src/wapi.js.window.WAPI.getGroupM鈥
I also encountered the same error and managed to solve it by using the update function in window.Store.GroupMetadata instead. Below is my updated WAPI.getGroupMetadata function:
window.WAPI.getGroupMetadata = async function (id, done) {
let output = window.Store.GroupMetadata.get(id);
if (output !== undefined) {
if (output.stale) {
await window.Store.GroupMetadata.update(id); // instead of output.update()
}
}
if (done !== undefined) done(output);
return output;
};
I hope this will help.
Most helpful comment
I also encountered the same error and managed to solve it by using the
updatefunction inwindow.Store.GroupMetadatainstead. Below is my updatedWAPI.getGroupMetadatafunction:I hope this will help.