status-desktop/ui/imports/shared/status/StatusChatImageSizeValidator.qml
Sale Djenic b3f8af8e06 refactor(@desktop/general): qml code referring to the old code base commented out
Qml code referring to the old code base commented out, but not deleted,
due to easier refactoring the rest of the app.
2022-02-01 11:42:42 +01:00

27 lines
798 B
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.0
import utils 1.0
import ".."
StatusChatImageValidator {
id: root
readonly property int maxImgSizeBytes: Constants.maxUploadFilesizeMB * 1048576 /* 1 MB in bytes */
onImagesChanged: {
// Not Refactored Yet
// let isValid = true
// root.validImages = images.filter(img => {
// let size = parseInt(utilsModel.getFileSize(img))
// const isSmallEnough = size <= maxImgSizeBytes
// isValid = isValid && isSmallEnough
// return isSmallEnough
// })
// root.isValid = isValid
}
//% "Max image size is %1 MB"
errorMessage: qsTrId("max-image-size-is--1-mb").arg(Constants.maxUploadFilesizeMB)
}