mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
e5ff0b4a6a
Fixes #9966 Uses the validate function to paste images so that it concatenates the previous images. FIxes the validate function to also accept data images. Moves the size validation function to Utils to reuse the data path prefix constant and fix the possible crash when we try to get the size of a data image.
19 lines
456 B
QML
19 lines
456 B
QML
import QtQuick 2.13
|
|
|
|
import utils 1.0
|
|
|
|
StatusChatImageValidator {
|
|
id: root
|
|
|
|
onImagesChanged: {
|
|
let isValid = true
|
|
root.validImages = images.filter(img => {
|
|
const isSmallEnough = Utils.isFilesizeValid(img)
|
|
isValid = isValid && isSmallEnough
|
|
return isSmallEnough
|
|
})
|
|
root.isValid = isValid
|
|
}
|
|
errorMessage: qsTr("Max image size is %1 MB").arg(Constants.maxUploadFilesizeMB)
|
|
}
|