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