From 541cfbdad5596e55b686abd02a93638f0a7f75f6 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 7 Aug 2021 21:36:46 +0000 Subject: ComposePane: set `id` to `root` --- qml/ComposePane.qml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'qml/ComposePane.qml') diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index 0ca189d..5ba77f5 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -5,6 +5,8 @@ import QtQuick.Layouts 1.12 import DeltaChat 1.0 Pane { + id: root + required property DcContext context required property var chatId @@ -22,7 +24,7 @@ Pane { selectByMouse: true Component.onCompleted: { - let draft = context.getDraft(chatId) + let draft = root.context.getDraft(chatId) if (draft) { messageField.text = draft.text } @@ -30,9 +32,9 @@ Pane { Connections { function onEditingFinished() { - var msg = context.newMessage(10) + var msg = root.context.newMessage(10) msg.setText(messageField.text) - context.setDraft(chatId, msg) + root.context.setDraft(chatId, msg) } } } @@ -46,9 +48,9 @@ Pane { text: qsTr("Send") enabled: messageField.length > 0 onClicked: { - chatPage.context.sendTextMessage(chatId, messageField.text) + root.context.sendTextMessage(chatId, messageField.text) messageField.text = "" - context.setDraft(chatId, null) + root.context.setDraft(chatId, null) } } } -- cgit v1.2.3-70-g09d2