Get 3PID binds on startup

Get binds on startup and update the staus properly after bind/unbinding 3PIDs
This commit is contained in:
James Graham
2024-06-08 08:42:34 +00:00
parent 8e5ccb5461
commit 91109ca845
4 changed files with 98 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ ColumnLayout {
id: threePIdDelegate
required property string address
required property string medium
required property bool isBound
contentItem: ColumnLayout {
RowLayout {
@@ -50,7 +51,13 @@ ColumnLayout {
color: Kirigami.Theme.textColor
}
QQC2.ToolButton {
visible: threePIdBindHelper.bindStatus === ThreePIdBindHelper.Ready && root.connection.hasIdentityServer
visible: root.connection.hasIdentityServer && threePIdDelegate.isBound
text: i18nc("@action:button", "Hide")
icon.name: "hide_table_row"
onClicked: threePIdBindHelper.unbind3PId(threePIdDelegate.address, threePIdDelegate.medium)
}
QQC2.ToolButton {
visible: threePIdBindHelper.bindStatus === ThreePIdBindHelper.Ready && root.connection.hasIdentityServer && !threePIdDelegate.isBound
text: i18nc("@action:button", "Share")
icon.name: "send-to-symbolic"
onClicked: threePIdBindHelper.bindStatus === ThreePIdBindHelper.Verification ? threePIdBindHelper.finalizeNewIdBind() : threePIdBindHelper.initiateNewIdBind()
@@ -70,7 +77,7 @@ ColumnLayout {
type: threePIdBindHelper.statusType
}
RowLayout {
visible: threePIdBindHelper.bindStatus !== ThreePIdBindHelper.Ready
visible: threePIdBindHelper.bindStatus !== ThreePIdBindHelper.Ready && threePIdBindHelper.bindStatus !== ThreePIdBindHelper.Success
Item {
Layout.fillWidth: true
}