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