fix(invitation-bubble): fix json parse
This commit is contained in:
parent
58532ba25d
commit
ed223f15da
|
@ -18,11 +18,22 @@ Item {
|
|||
width: rectangleBubbleLoader.width
|
||||
|
||||
function getCommunity() {
|
||||
let community = JSON.parse(chatsModel.communities.list.getCommunityByIdJson(communityId));
|
||||
try {
|
||||
const communityJson = chatsModel.communities.list.getCommunityByIdJson(communityId)
|
||||
if (!communityJson) {
|
||||
return null
|
||||
}
|
||||
|
||||
let community = JSON.parse(communityJson);
|
||||
if (community) {
|
||||
community.nbMembers = community.members.length;
|
||||
}
|
||||
return community
|
||||
} catch (e) {
|
||||
console.error("Error parsing community", e)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
|
Loading…
Reference in New Issue