fix breaking when no languages set

This commit is contained in:
saltrafael 2021-06-13 08:51:49 -03:00
parent 166c3b2832
commit 0758827e6d
2 changed files with 2 additions and 2 deletions

2
dist/bundle.es.js vendored
View file

@ -5430,7 +5430,7 @@ const selectIsStillEditing = reselect.createSelector(selectState$4, publishState
const selectPublishFormValues = reselect.createSelector(selectState$4, state => state.settings, selectIsStillEditing, (publishState, settingsState, isStillEditing) => {
const { languages } = publishState,
formValues = _objectWithoutProperties$2(publishState, ['languages']);
const language = languages[0];
const language = languages && languages.length && languages[0];
const { clientSettings } = settingsState;
const { language: languageSet } = clientSettings;

View file

@ -44,7 +44,7 @@ export const selectPublishFormValues = createSelector(
selectIsStillEditing,
(publishState, settingsState, isStillEditing) => {
const { languages, ...formValues } = publishState;
const language = languages[0];
const language = languages && languages.length && languages[0];
const { clientSettings } = settingsState;
const { language: languageSet } = clientSettings;