diff --git a/TODO.md b/TODO.md index 45b00721..341f267f 100644 --- a/TODO.md +++ b/TODO.md @@ -32,6 +32,7 @@ - Change typing bar background - Show error if uploading avatar fails or file is corrupted - Way to open context menus without a right mouse button + - Room header descriptions: styled text - Single message context menu - Copy text diff --git a/src/qml/Pages/EditAccount/Encryption.qml b/src/qml/Pages/EditAccount/Encryption.qml index 385fb974..573e3309 100644 --- a/src/qml/Pages/EditAccount/Encryption.qml +++ b/src/qml/Pages/EditAccount/Encryption.qml @@ -2,24 +2,6 @@ import QtQuick 2.12 import "../../Base" HLoader { - property bool importing: false - - - function importKeys(file, passphrase, button=null) { - if (button) button.loading = true - importing = true - - let path = file.toString().replace(/^file:\/\//, "") - - py.callClientCoro( - editAccount.userId, "import_keys", [path, passphrase], () => { - importing = false - if (button) button.loading = false - } - ) - } - - id: encryptionUI source: accountInfo.import_error[0] ? "ImportError.qml" : @@ -28,6 +10,27 @@ HLoader { onSourceChanged: animation.running = true + + property bool importing: false + + + function importKeys(file, passphrase, button=null) { + if (button) button.loading = true + encryptionUI.importing = true + + let path = file.toString().replace(/^file:\/\//, "") + + py.callClientCoro( + editAccount.userId, "import_keys", [path, passphrase], () => { + if (encryptionUI !== null) { // null: user is on another page + encryptionUI.importing = false + if (button) button.loading = false + } + } + ) + } + + SequentialAnimation { id: animation HNumberAnimation {