Fix enable/disable save button when image.source is empty. Otherwise it will crash

This commit is contained in:
Laurent Montel
2023-09-04 19:03:06 +00:00
committed by Tobias Fella
parent d43cc9a044
commit 0d5929b4bc

View File

@@ -109,7 +109,7 @@ FormCard.FormCardPage {
id: save
text: i18n("Save")
icon.name: "document-save"
enabled: !root.newEmoticon || (image.source && shortcode.text && description.text)
enabled: !root.newEmoticon || (image.source.toString().length > 0 && shortcode.text && description.text)
onClicked: {
if (root.newEmoticon) {
model.addEmoticon(image.source, shortcode.text, description.text, emoticonType === EmoticonFormCard.Stickers ? "sticker" : "emoticon")