From 3456c5232b427b1159f5a5f85c4d9731088ea539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Wed, 16 Nov 2022 10:54:45 +0100 Subject: [PATCH] fix: Copy to clipboard button in profile view should reset to "Copy" Fixes #8219 --- ui/imports/shared/views/ProfileDialogView.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/imports/shared/views/ProfileDialogView.qml b/ui/imports/shared/views/ProfileDialogView.qml index c915a2a074..541ea52128 100644 --- a/ui/imports/shared/views/ProfileDialogView.qml +++ b/ui/imports/shared/views/ProfileDialogView.qml @@ -93,6 +93,10 @@ Pane { if (publicKey === root.publicKey) d.reload() } } + + readonly property var timer: Timer { + id: timer + } } function reload() { @@ -585,6 +589,7 @@ Pane { placeholderTextColor: Theme.palette.directColor1 edit.readOnly: true rightComponent: StatusButton { + id: copyLinkBtn anchors.verticalCenter: parent.verticalCenter borderColor: Theme.palette.primaryColor1 size: StatusBaseButton.Size.Tiny @@ -592,6 +597,9 @@ Pane { onClicked: { text = qsTr("Copied") root.profileStore.copyToClipboard(d.linkToProfile) + d.timer.setTimeout(function() { + copyLinkBtn.text = qsTr("Copy") + }, 2000); } } } @@ -616,6 +624,7 @@ Pane { oneRow: !root.readOnly } rightComponent: StatusButton { + id: copyHashBtn anchors.verticalCenter: parent.verticalCenter borderColor: Theme.palette.primaryColor1 size: StatusBaseButton.Size.Tiny @@ -623,6 +632,9 @@ Pane { onClicked: { root.profileStore.copyToClipboard(Utils.getEmojiHashAsJson(root.publicKey).join("").toString()) text = qsTr("Copied") + d.timer.setTimeout(function() { + copyHashBtn.text = qsTr("Copy") + }, 2000); } } }