Skip to content

Commit f49d22d

Browse files
committed
Disable Auto-Publish with Media Attachments
1 parent f341102 commit f49d22d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

public/scripts/form.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ function isAttachmentsInputValid(data) {
5151
data.get('pollOptionD');
5252
const linkAttached = data.get('linkAttachment');
5353
const hasMediaAttachment = data.has('attachmentType[]');
54+
const autoPublishText = data.get('autoPublishText');
5455

5556
if (pollAttached && linkAttached) {
5657
alert('Link attachments and poll attachments cannot be used together.');
5758
return false;
5859
}
5960

61+
if (hasMediaAttachment && autoPublishText) {
62+
alert('Media attachments cannot be automatically published.')
63+
return false;
64+
}
65+
6066
if (hasMediaAttachment && linkAttached) {
6167
alert('Link attachments can only be used with text posts.')
6268
}

0 commit comments

Comments
 (0)