fix disabled publish form

This commit is contained in:
zeppi 2021-04-26 13:45:36 -04:00 committed by jessopb
parent b0996d4d18
commit 830375cb32

View file

@ -202,7 +202,7 @@ function PublishForm(props: Props) {
const [signedMessage, setSignedMessage] = React.useState({ signature: undefined, signing_ts: undefined }); const [signedMessage, setSignedMessage] = React.useState({ signature: undefined, signing_ts: undefined });
const signedMessageStr = JSON.stringify(signedMessage); const signedMessageStr = JSON.stringify(signedMessage);
const TAGS_LIMIT = 5; const TAGS_LIMIT = 5;
const fileFormDisabled = mode === PUBLISH_MODES.FILE && !filePath; const fileFormDisabled = mode === PUBLISH_MODES.FILE && !filePath && !remoteUrl;
const emptyPostError = mode === PUBLISH_MODES.POST && (!fileText || fileText.trim() === ''); const emptyPostError = mode === PUBLISH_MODES.POST && (!fileText || fileText.trim() === '');
const formDisabled = (fileFormDisabled && !editingURI) || emptyPostError || publishing; const formDisabled = (fileFormDisabled && !editingURI) || emptyPostError || publishing;
const isInProgress = filePath || editingURI || name || title; const isInProgress = filePath || editingURI || name || title;