diff --git a/locales/de-DE.yml b/locales/de-DE.yml index d04480e43..90078ec7d 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -756,6 +756,7 @@ noMaintainerInformationWarning: "Betreiberinformationen sind nicht konfiguriert. noBotProtectionWarning: "Schutz vor Bots ist nicht konfiguriert." configure: "Konfigurieren" postToGallery: "Neuen Galeriebeitrag erstellen" +attachmentRequired: "Mindestens 1 Anhang ist erforderlich." gallery: "Galerie" recentPosts: "Neue Beiträge" popularPosts: "Beliebte Beiträge" diff --git a/locales/en-US.yml b/locales/en-US.yml index db041e692..36a5999ed 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -756,6 +756,7 @@ noMaintainerInformationWarning: "Maintainer information is not configured." noBotProtectionWarning: "Bot protection is not configured." configure: "Configure" postToGallery: "Create new gallery post" +attachmentRequired: "At least 1 attachment is required." gallery: "Gallery" recentPosts: "Recent posts" popularPosts: "Popular posts" diff --git a/packages/client/src/pages/gallery/edit.vue b/packages/client/src/pages/gallery/edit.vue index a6b1015bf..9d567c570 100644 --- a/packages/client/src/pages/gallery/edit.vue +++ b/packages/client/src/pages/gallery/edit.vue @@ -66,6 +66,14 @@ function remove(file) { } async function save() { + if (files.length === 0) { + os.alert({ + type: 'error', + text: i18n.ts.attachmentRequired, + }); + return; + } + if (props.postId) { await os.apiWithDialog('gallery/posts/update', { postId: props.postId,