2020-12-11 20:38:10 +00:00
|
|
|
import QtQuick 2.3
|
2021-04-29 19:54:09 +00:00
|
|
|
import QtQuick.Dialogs 1.3
|
2020-12-11 20:38:10 +00:00
|
|
|
import "../../../../../shared"
|
|
|
|
import "../../../../../shared/status"
|
|
|
|
import "../../../../../imports"
|
|
|
|
import "./TransactionComponents"
|
|
|
|
import "../../../Wallet/data"
|
|
|
|
|
|
|
|
Item {
|
2021-03-08 20:21:56 +00:00
|
|
|
property string communityId
|
2020-12-11 20:38:10 +00:00
|
|
|
property var invitedCommunity
|
|
|
|
property int innerMargin: 12
|
2021-03-08 20:21:56 +00:00
|
|
|
property bool isLink: false
|
2020-12-11 20:38:10 +00:00
|
|
|
|
|
|
|
id: root
|
|
|
|
anchors.left: parent.left
|
|
|
|
height: childrenRect.height
|
2021-04-30 14:45:13 +00:00
|
|
|
width: rectangleBubbleLoader.width
|
2020-12-11 20:38:10 +00:00
|
|
|
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
function getCommunity() {
|
|
|
|
let community = JSON.parse(chatsModel.communities.list.getCommunityByIdJson(communityId));
|
|
|
|
if (community) {
|
|
|
|
community.nbMembers = community.members.length;
|
|
|
|
}
|
|
|
|
return community
|
|
|
|
}
|
|
|
|
|
2020-12-11 20:38:10 +00:00
|
|
|
Component.onCompleted: {
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
root.invitedCommunity = getCommunity()
|
|
|
|
}
|
2020-12-11 20:38:10 +00:00
|
|
|
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
Connections {
|
|
|
|
target: chatsModel.communities
|
|
|
|
onCommunityChanged: function (communityId) {
|
|
|
|
if (communityId === root.communityId) {
|
|
|
|
root.invitedCommunity = getCommunity()
|
|
|
|
}
|
|
|
|
}
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
|
|
|
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
|
2020-12-11 20:38:10 +00:00
|
|
|
Loader {
|
|
|
|
id: rectangleBubbleLoader
|
|
|
|
active: !!invitedCommunity
|
|
|
|
width: item.width
|
|
|
|
height: item.height
|
|
|
|
|
|
|
|
sourceComponent: Component {
|
|
|
|
Rectangle {
|
|
|
|
id: rectangleBubble
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
property alias button: joinBtn
|
|
|
|
property bool isPendingRequest: chatsModel.communities.isCommunityRequestPending(communityId)
|
2020-12-11 20:38:10 +00:00
|
|
|
width: 270
|
|
|
|
height: childrenRect.height + Style.current.halfPadding
|
|
|
|
radius: 16
|
|
|
|
color: Style.current.background
|
|
|
|
border.color: Style.current.border
|
|
|
|
border.width: 1
|
|
|
|
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
states: [
|
|
|
|
State {
|
|
|
|
name: "requiresEns"
|
|
|
|
when: invitedCommunity.ensOnly && !profileModel.profile.ensVerified
|
|
|
|
PropertyChanges {
|
|
|
|
target: joinBtn
|
|
|
|
text: qsTr("Membership requires an ENS username")
|
|
|
|
enabled: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "inviteOnly"
|
|
|
|
when: invitedCommunity.access === Constants.communityChatInvitationOnlyAccess
|
|
|
|
PropertyChanges {
|
|
|
|
target: joinBtn
|
|
|
|
text: qsTr("You need to be invited")
|
|
|
|
enabled: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "pending"
|
|
|
|
when: invitedCommunity.access === Constants.communityChatOnRequestAccess &&
|
|
|
|
rectangleBubble.isPendingRequest
|
|
|
|
PropertyChanges {
|
|
|
|
target: joinBtn
|
|
|
|
text: qsTr("Pending")
|
|
|
|
enabled: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "joined"
|
|
|
|
when: invitedCommunity.joined && invitedCommunity.isMember
|
|
|
|
PropertyChanges {
|
|
|
|
target: joinBtn
|
|
|
|
text: qsTr("View")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "requestToJoin"
|
|
|
|
when: invitedCommunity.access === Constants.communityChatOnRequestAccess &&
|
|
|
|
// !invitedCommunity.joined && !invitedCommunity.isMember
|
|
|
|
invitedCommunity.canRequestAccess
|
|
|
|
PropertyChanges {
|
|
|
|
target: joinBtn
|
2021-06-22 18:27:00 +00:00
|
|
|
text: qsTr("Request Access")
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "unjoined"
|
|
|
|
when: invitedCommunity.access === Constants.communityChatOnRequestAccess &&
|
|
|
|
invitedCommunity.isMember
|
|
|
|
PropertyChanges {
|
|
|
|
target: joinBtn
|
|
|
|
text: qsTr("Join")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: chatsModel.communities
|
|
|
|
onMembershipRequestChanged: function(communityId, communityName, requestAccepted) {
|
|
|
|
if (communityId === root.communityId) {
|
|
|
|
rectangleBubble.isPendingRequest = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-11 20:38:10 +00:00
|
|
|
// TODO add check if verified
|
|
|
|
StyledText {
|
|
|
|
id: title
|
|
|
|
color: invitedCommunity.verifed ? Style.current.primary : Style.current.secondaryText
|
|
|
|
text: invitedCommunity.verifed ?
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Verified community invitation"
|
|
|
|
qsTrId("verified-community-invitation") :
|
|
|
|
//% "Community invitation"
|
|
|
|
qsTrId("community-invitation")
|
2020-12-11 20:38:10 +00:00
|
|
|
font.weight: Font.Medium
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: root.innerMargin
|
|
|
|
font.pixelSize: 13
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: invitedYou
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
text: {
|
|
|
|
if (chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne) {
|
|
|
|
return isCurrentUser ?
|
2021-06-17 22:09:00 +00:00
|
|
|
qsTr("You invited %1 to join a community").arg(chatsModel.userNameOrAlias(chatsModel.channelView.activeChannel.id))
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
//% "%1 invited you to join a community"
|
|
|
|
: qsTrId("-1-invited-you-to-join-a-community").arg(displayUserName)
|
|
|
|
} else {
|
|
|
|
return isCurrentUser ?
|
|
|
|
qsTr("You shared a community")
|
|
|
|
: qsTr("A community has been shared")
|
|
|
|
}
|
|
|
|
}
|
2020-12-11 20:38:10 +00:00
|
|
|
anchors.top: title.bottom
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: root.innerMargin
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: root.innerMargin
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: sep1
|
|
|
|
anchors.top: invitedYou.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO add image when it's supported
|
|
|
|
StyledText {
|
|
|
|
id: communityName
|
|
|
|
text: invitedCommunity.name
|
|
|
|
anchors.top: sep1.bottom
|
|
|
|
anchors.topMargin: root.innerMargin
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: root.innerMargin
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: root.innerMargin
|
|
|
|
font.weight: Font.Bold
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 17
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: communityDesc
|
|
|
|
text: invitedCommunity.description
|
|
|
|
anchors.top: communityName.bottom
|
|
|
|
anchors.topMargin: 2
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: root.innerMargin
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: root.innerMargin
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: communityNbMembers
|
|
|
|
// TODO add the plural support
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "%1 members"
|
|
|
|
text: qsTrId("-1-members").arg(invitedCommunity.nbMembers)
|
2020-12-11 20:38:10 +00:00
|
|
|
anchors.top: communityDesc.bottom
|
|
|
|
anchors.topMargin: 2
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: root.innerMargin
|
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Medium
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: sep2
|
|
|
|
anchors.top: communityNbMembers.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
2021-04-29 19:54:09 +00:00
|
|
|
id: joinBtn
|
2020-12-11 20:38:10 +00:00
|
|
|
type: "secondary"
|
|
|
|
anchors.top: sep2.bottom
|
|
|
|
width: parent.width
|
|
|
|
height: 44
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
enabled: true
|
|
|
|
text: qsTr("Unsupported state")
|
2021-04-29 19:54:09 +00:00
|
|
|
|
2020-12-11 20:38:10 +00:00
|
|
|
onClicked: {
|
2021-04-29 19:54:09 +00:00
|
|
|
let error
|
2021-06-02 12:28:15 +00:00
|
|
|
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
if (rectangleBubble.state === "joined") {
|
2021-06-02 12:28:15 +00:00
|
|
|
chatsModel.communities.setActiveCommunity(communityId);
|
|
|
|
return
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
} else if (rectangleBubble.state === "unjoined") {
|
|
|
|
error = chatsModel.communities.joinCommunity(communityId, true)
|
2021-06-02 12:28:15 +00:00
|
|
|
}
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
else if (rectangleBubble.state === "requestToJoin") {
|
2021-04-29 19:54:09 +00:00
|
|
|
error = chatsModel.communities.requestToJoinCommunity(communityId,
|
|
|
|
profileModel.profile.ensVerified ? profileModel.profile.username : "")
|
|
|
|
if (!error) {
|
fix(communities): re-joining of left communities
Fixes: #2649.
Upon receipt of status-go signals which included communities that have been left (`joined: false`), those communities were being rejoined automatically when they should not have been.
fix(communities): Invitation bubble button state updates
The community state inside of the invitation bubble was not reactive to any community actions (such as joining, leaving, updating). In addition, requesting to join a community changed the button’s text to “Pending”, but upon approval, the button’s state was not updating.
The component was setting an observed community in the Component.onCompleted event, which was occurring for all invitation bubbles, but because the community wasn’t bound correctly to the bubble, once a bubble with a different community was encountered, the community in context of the bubble wasn’t updated and instead used a local copy. Once the community was bound correctly (to be reactive), the states started working correctly.
The invitation bubble has been simplied so that it has states instead of using lots of if/else statements inside of the property bindings. This simplified the component’s logic for things like onClick action and made it a lot easier to read and modify.
2021-06-24 07:21:45 +00:00
|
|
|
rectangleBubble.isPendingRequest = chatsModel.communities.isCommunityRequestPending(communityId)
|
2021-04-29 19:54:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
joiningError.text = error
|
|
|
|
return joiningError.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageDialog {
|
|
|
|
id: joiningError
|
|
|
|
//% "Error joining the community"
|
|
|
|
title: qsTrId("error-joining-the-community")
|
|
|
|
icon: StandardIcon.Critical
|
|
|
|
standardButtons: StandardButton.Ok
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#4c4e50";formeditorZoom:1.25}
|
|
|
|
}
|
|
|
|
##^##*/
|