aboutsummaryrefslogtreecommitdiff
path: root/qml/ComposePane.qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-05-29 23:40:34 +0300
committerlink2xt <link2xt@testrun.org>2021-05-29 23:40:34 +0300
commit69ff191c83e5277cfe22d3735e9ac2f0256be3c5 (patch)
treea138c9a4b1914d9ef20e19d9f24401ee0179b984 /qml/ComposePane.qml
parent9c22c6d6a03f620f14f289b464354159b8a76f6b (diff)
downloadkdeltachat-69ff191c83e5277cfe22d3735e9ac2f0256be3c5.tar.gz
kdeltachat-69ff191c83e5277cfe22d3735e9ac2f0256be3c5.zip
Implement message drafts
Diffstat (limited to 'qml/ComposePane.qml')
-rw-r--r--qml/ComposePane.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml
index 54480d5..44cbd7c 100644
--- a/qml/ComposePane.qml
+++ b/qml/ComposePane.qml
@@ -20,6 +20,21 @@ Pane {
placeholderText: qsTr("Message")
wrapMode: TextArea.Wrap
selectByMouse: true
+
+ Component.onCompleted: {
+ let draft = context.getDraft(chatId)
+ if (draft) {
+ messageField.text = draft.text
+ }
+ }
+
+ Connections {
+ function onEditingFinished() {
+ var msg = context.newMessage(10)
+ msg.setText(messageField.text)
+ context.setDraft(chatId, msg)
+ }
+ }
}
Button {