client: improve error message for empty gallery posts

closes FoundKeyGang/FoundKey#153

Changelog: Fixed
This commit is contained in:
Johann150 2022-09-15 22:01:16 +02:00
parent 4dac197dff
commit a932f91c04
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
3 changed files with 10 additions and 0 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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,