Fix error when using upload button more than once

This commit is contained in:
miruka 2019-11-05 18:30:51 -04:00
parent 8f3df28b9d
commit 91064fc625

View File

@ -216,6 +216,7 @@ Rectangle {
HFileDialogOpener { HFileDialogOpener {
dialog.title: qsTr("Select files to upload") dialog.title: qsTr("Select files to upload")
onFileChanged: { onFileChanged: {
if (! file) return
let path = Qt.resolvedUrl(file).replace(/^file:/, "") let path = Qt.resolvedUrl(file).replace(/^file:/, "")
let args = [chatPage.roomId, path] let args = [chatPage.roomId, path]
py.callClientCoro(chatPage.userId, "send_file", args) py.callClientCoro(chatPage.userId, "send_file", args)