Fix for issue #4

Fixes ssue with empty profile page when clicking on username in toots.
This commit is contained in:
molan-git 2020-01-16 16:34:12 +00:00 committed by GitHub
parent e99c500901
commit bc338c39a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -142,16 +142,17 @@ BackgroundItem {
right: parent.right right: parent.right
top: lblScreenName.bottom top: lblScreenName.bottom
topMargin: Theme.paddingSmall topMargin: Theme.paddingSmall
rightMargin: Theme.paddingLarge rightMargin: Theme.paddingLarge
} }
height: content.length ? paintedHeight : 0 height: content.length ? paintedHeight : 0
onLinkActivated: { onLinkActivated: {
console.log(link) console.log(link)
if (link[0] === "@") { if (link[0] === "@") {
pageStack.push(Qt.resolvedUrl("../Profile.qml"), { pageStack.push(Qt.resolvedUrl("../Profile.qml"), {
"name": "", "display_name": account_display_name,
"username": link.substring(1), "username": account_username,
"profileImage": "" "user_id": model.account_id,
"profileImage": account_avatar
}) })
} else if (link[0] === "#") { } else if (link[0] === "#") {

View file

@ -135,9 +135,10 @@ BackgroundItem {
send(link) send(link)
} else if (test.length === 4 && test[3][0] === "@" ) { } else if (test.length === 4 && test[3][0] === "@" ) {
pageStack.push(Qt.resolvedUrl("../Profile.qml"), { pageStack.push(Qt.resolvedUrl("../Profile.qml"), {
"name": "", "display_name": account_display_name,
"username": test[3].substring(1)+"@"+test[2], "username": account_username,
"profileImage": "" "user_id": model.account_id,
"profileImage": account_avatar
}) })
} else { } else {
Qt.openUrlExternally(link); Qt.openUrlExternally(link);