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.
25 lines
669 B
QML
25 lines
669 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
|
|
|
|
errorMessage: qsTr("Format not supported.")
|
|
secondaryErrorMessage: qsTr("Upload %1 only").arg(Constants.acceptedDragNDropImageExtensions.map(ext => ext.replace(".", "").toUpperCase() + "s").join(", "))
|
|
|
|
onImagesChanged: {
|
|
let isValid = true
|
|
root.validImages = images.filter(img => {
|
|
const isImage = Utils.isValidDragNDropImage(img)
|
|
isValid = isValid && isImage
|
|
return isImage
|
|
})
|
|
root.isValid = isValid
|
|
}
|
|
}
|