fix: media config top level (#716)
This commit is contained in:
parent
f27a7cd420
commit
12179e59a2
@ -188,6 +188,7 @@
|
||||
'---\ntitle: "This is post # ' +
|
||||
i +
|
||||
`\"\ndraft: ${i % 2 === 0}` +
|
||||
'\nimage: /assets/uploads/lobby.jpg' +
|
||||
'\ndate: ' +
|
||||
dateString +
|
||||
'T00:00:00.000Z\n---\n# The post is number ' +
|
||||
|
@ -72,6 +72,8 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
|
||||
const [selectedFile, setSelectedFile] = useState<MediaFile | null>(null);
|
||||
const [query, setQuery] = useState<string | undefined>(undefined);
|
||||
|
||||
const config = useAppSelector(selectConfig);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const {
|
||||
isVisible,
|
||||
@ -83,7 +85,7 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
|
||||
isLoading,
|
||||
hasNextPage,
|
||||
isPaginating,
|
||||
config: mediaConfig,
|
||||
config: mediaConfig = config?.media_library ?? {},
|
||||
dynamicSearchQuery,
|
||||
page,
|
||||
collection,
|
||||
@ -94,7 +96,6 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
|
||||
insertOptions,
|
||||
} = useAppSelector(selectMediaLibraryState);
|
||||
|
||||
const config = useAppSelector(selectConfig);
|
||||
const entry = useAppSelector(selectEditingDraft);
|
||||
|
||||
const [url, setUrl] = useState<string | string[] | undefined>(initialValue ?? '');
|
||||
|
@ -40,7 +40,7 @@ export type MediaLibraryState = {
|
||||
controlID?: string;
|
||||
page?: number;
|
||||
files?: MediaFile[];
|
||||
config: MediaLibraryConfig;
|
||||
config?: MediaLibraryConfig;
|
||||
collection?: Collection;
|
||||
collectionFile?: CollectionFile;
|
||||
field?: MediaField;
|
||||
@ -65,7 +65,6 @@ const defaultState: MediaLibraryState = {
|
||||
showMediaButton: true,
|
||||
controlMedia: {},
|
||||
displayURLs: {},
|
||||
config: {},
|
||||
};
|
||||
|
||||
function mediaLibrary(
|
||||
|
Loading…
x
Reference in New Issue
Block a user