Proper upload exceptions, handle in QML set avatar

This commit is contained in:
miruka
2019-10-28 08:06:22 -04:00
parent 5894481dc5
commit 6eb3a378bc
3 changed files with 29 additions and 27 deletions

View File

@@ -28,12 +28,12 @@ HGridLayout {
saveButton.avatarChangeRunning = true
let path = Qt.resolvedUrl(avatar.imageUrl).replace(/^file:/, "")
py.callClientCoro(
userId, "set_avatar_from_file", [path], response => {
saveButton.avatarChangeRunning = false
if (response != true) { print(response) }
}
)
py.callClientCoro(userId, "set_avatar_from_file", [path], () => {
saveButton.avatarChangeRunning = false
}, (errType, [httpCode]) => {
console.error("Avatar upload failed:", httpCode, errType)
saveButton.avatarChangeRunning = false
})
}
}