fix metadata not updating if post content doesn't change
This commit is contained in:
parent
b006121b6a
commit
d64d278676
1 changed files with 4 additions and 5 deletions
|
@ -247,9 +247,7 @@ function PublishForm(props: Props) {
|
||||||
// Publish post:
|
// Publish post:
|
||||||
// If here is no file selected yet on desktop, show file dialog and let the
|
// If here is no file selected yet on desktop, show file dialog and let the
|
||||||
// user choose a file path. On web a new File is created
|
// user choose a file path. On web a new File is created
|
||||||
const validPost = !emptyPostError;
|
if (mode === PUBLISH_MODES.POST && !emptyPostError) {
|
||||||
|
|
||||||
if (mode === PUBLISH_MODES.POST) {
|
|
||||||
let outputFile = filePath;
|
let outputFile = filePath;
|
||||||
// If user modified content on the text editor or editing name has changed:
|
// If user modified content on the text editor or editing name has changed:
|
||||||
// Save changes and update file path
|
// Save changes and update file path
|
||||||
|
@ -263,11 +261,12 @@ function PublishForm(props: Props) {
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
// New content stored locally and is not empty
|
// New content stored locally and is not empty
|
||||||
if (outputFile && validPost) {
|
if (outputFile) {
|
||||||
updatePublishForm({ filePath: outputFile });
|
updatePublishForm({ filePath: outputFile });
|
||||||
publish(outputFile);
|
publish(outputFile);
|
||||||
}
|
}
|
||||||
} else if (validPost && outputFile) {
|
} else {
|
||||||
|
// Only metadata has changed.
|
||||||
publish(outputFile);
|
publish(outputFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue