mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 05:52:41 +00:00
623333ab8c
- use the same approach as status-go to detect the image type, relying on "magic" type matching instead of looking at the file extension (now using C++ and QMime*) - add a little error popup when the user tries to upload an unsupported image type while creating/editing a community - expose all the image related properties from the C++ backend instead of constructing and duplicating them in QML - cleanup some unused/dead code Fixes #16668
23 lines
569 B
QML
23 lines
569 B
QML
import QtQuick 2.15
|
|
|
|
import StatusQ 0.1
|
|
|
|
import utils 1.0
|
|
|
|
StatusChatImageValidator {
|
|
id: root
|
|
|
|
errorMessage: qsTr("Format not supported.")
|
|
secondaryErrorMessage: qsTr("Upload %1 only").arg(UrlUtils.validPreferredImageExtensions.map(ext => ext.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
|
|
}
|
|
}
|