fix: i18n reversion (#860)
This commit is contained in:
parent
b3143148ab
commit
42ec8e8252
@ -4,7 +4,7 @@ import { ScrollSyncPane } from 'react-scroll-sync';
|
|||||||
import { EDITOR_SIZE_COMPACT } from '@staticcms/core/constants/views';
|
import { EDITOR_SIZE_COMPACT } from '@staticcms/core/constants/views';
|
||||||
import { summaryFormatter } from '@staticcms/core/lib/formatters';
|
import { summaryFormatter } from '@staticcms/core/lib/formatters';
|
||||||
import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs';
|
import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs';
|
||||||
import { getI18nInfo, hasI18n } from '@staticcms/core/lib/i18n';
|
import { getI18nInfo, getPreviewEntry, hasI18n } from '@staticcms/core/lib/i18n';
|
||||||
import classNames from '@staticcms/core/lib/util/classNames.util';
|
import classNames from '@staticcms/core/lib/util/classNames.util';
|
||||||
import {
|
import {
|
||||||
getFileFromSlug,
|
getFileFromSlug,
|
||||||
@ -305,6 +305,10 @@ const EditorInterface = ({
|
|||||||
[collection, entry, fields, fieldsErrors, handleLocaleChange, selectedLocale, submitted, t],
|
[collection, entry, fields, fieldsErrors, handleLocaleChange, selectedLocale, submitted, t],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const previewEntry = collectHasI18n
|
||||||
|
? getPreviewEntry(entry, selectedLocale, defaultLocale)
|
||||||
|
: entry;
|
||||||
|
|
||||||
const mobileLocaleEditor = useMemo(
|
const mobileLocaleEditor = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<div
|
<div
|
||||||
@ -351,7 +355,7 @@ const EditorInterface = ({
|
|||||||
collection={collection}
|
collection={collection}
|
||||||
previewInFrame={previewInFrame}
|
previewInFrame={previewInFrame}
|
||||||
livePreviewUrlTemplate={livePreviewUrlTemplate}
|
livePreviewUrlTemplate={livePreviewUrlTemplate}
|
||||||
entry={entry}
|
entry={previewEntry}
|
||||||
fields={fields}
|
fields={fields}
|
||||||
editorSize={editorSize}
|
editorSize={editorSize}
|
||||||
showMobilePreview={showMobilePreview}
|
showMobilePreview={showMobilePreview}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user