Commit 6fb3c499 authored by Filipe Azevedo's avatar Filipe Azevedo Committed by LNJ

Fix upload runtime issues

parent 72b60272
......@@ -286,6 +286,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
qmlRegisterUncreatableType<QAbstractItemModel>("EmojiModel", 0, 1, "QAbstractItemModel", "Used by proxy models");
qmlRegisterUncreatableType<Emoji>("EmojiModel", 0, 1, "Emoji", "Used by emoji models");
qmlRegisterUncreatableType<TransferJob>(APPLICATION_ID, 1, 0, "TransferJob", "TransferJob type usable");
qmlRegisterUncreatableMetaObject(Enums::staticMetaObject, APPLICATION_ID,
1, 0, "Enums", "Can't create object; only enums defined!");
......
......@@ -50,11 +50,12 @@ RowLayout {
property bool edited
property bool isLoading: kaidan.transferCache.hasUpload(msgId)
property string name
property var upload: {
if (mediaType !== Enums.MessageText &&
kaidan.transferCache.hasUpload(msgId)) {
kaidan.transferCache.jobByMessageId(model.id)
property TransferJob upload: {
if (mediaType !== Enums.MessageType.MessageText && isLoading) {
return kaidan.transferCache.jobByMessageId(model.id)
}
return null
}
property bool isSpoiler
property string spoilerHint
......@@ -266,7 +267,7 @@ RowLayout {
// progress bar for upload/download status
Controls.ProgressBar {
visible: isLoading
value: isLoading ? upload.progress : 0
value: upload ? upload.progress : 0
}
Controls.Label {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment