2021-03-10 04:59:01 +00:00
|
|
|
import QtQuick 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-03-10 04:59:01 +00:00
|
|
|
|
|
|
|
StatusChatImageValidator {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
onImagesChanged: {
|
2021-12-14 16:11:31 +00:00
|
|
|
let isValid = true
|
|
|
|
root.validImages = images.filter(img => {
|
2023-03-27 17:53:17 +00:00
|
|
|
const isSmallEnough = Utils.isFilesizeValid(img)
|
2021-12-14 16:11:31 +00:00
|
|
|
isValid = isValid && isSmallEnough
|
|
|
|
return isSmallEnough
|
|
|
|
})
|
|
|
|
root.isValid = isValid
|
2021-03-10 04:59:01 +00:00
|
|
|
}
|
2022-04-04 11:26:30 +00:00
|
|
|
errorMessage: qsTr("Max image size is %1 MB").arg(Constants.maxUploadFilesizeMB)
|
2021-12-13 14:24:21 +00:00
|
|
|
}
|