Avoid import harmless error messages at the end
This commit is contained in:
parent
dc209bc5d4
commit
5eaa877554
1
TODO.md
1
TODO.md
|
@ -32,6 +32,7 @@
|
||||||
- Change typing bar background
|
- Change typing bar background
|
||||||
- Show error if uploading avatar fails or file is corrupted
|
- Show error if uploading avatar fails or file is corrupted
|
||||||
- Way to open context menus without a right mouse button
|
- Way to open context menus without a right mouse button
|
||||||
|
- Room header descriptions: styled text
|
||||||
|
|
||||||
- Single message context menu
|
- Single message context menu
|
||||||
- Copy text
|
- Copy text
|
||||||
|
|
|
@ -2,24 +2,6 @@ import QtQuick 2.12
|
||||||
import "../../Base"
|
import "../../Base"
|
||||||
|
|
||||||
HLoader {
|
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
|
id: encryptionUI
|
||||||
source:
|
source:
|
||||||
accountInfo.import_error[0] ? "ImportError.qml" :
|
accountInfo.import_error[0] ? "ImportError.qml" :
|
||||||
|
@ -28,6 +10,27 @@ HLoader {
|
||||||
|
|
||||||
onSourceChanged: animation.running = true
|
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 {
|
SequentialAnimation {
|
||||||
id: animation
|
id: animation
|
||||||
HNumberAnimation {
|
HNumberAnimation {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user