diff options
Diffstat (limited to 'qml/ComposePane.qml')
-rw-r--r-- | qml/ComposePane.qml | 15 |
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 { |