Skip to content

Commit

Permalink
FIX Default to empty title on saving a block when no redux form data …
Browse files Browse the repository at this point in the history
…is available

Fixes #603
  • Loading branch information
robbieaverill committed Feb 10, 2019
1 parent a6ff3d2 commit 0b244bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions client/src/components/ElementActions/SaveAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const SaveAction = (MenuComponent) => (props) => {
const preview = $('.cms-preview');
preview.entwine('ss.preview')._loadUrl(preview.find('iframe').attr('src'));

const newTitle = formData[`PageElements_${element.ID}_Title`];
const newTitle = formData ? formData[`PageElements_${element.ID}_Title`] : null;
$.noticeAdd({
text: i18n.inject(
i18n._t(
Expand All @@ -64,7 +64,8 @@ const SaveAction = (MenuComponent) => (props) => {
type: 'success'
});
})
.catch(() => {
.catch((something) => {
console.log(something);
$.noticeAdd({
text: i18n.inject(
i18n._t(
Expand Down

0 comments on commit 0b244bb

Please sign in to comment.