refactor: remove duplicate trim call

This commit is contained in:
Daniel Lautzenheiser 2023-04-12 15:28:16 -04:00
parent 5384b5c7a2
commit 8c817d442b

View File

@ -5,7 +5,6 @@ import { Home as HomeIcon } from '@styled-icons/material/Home';
import { Photo as PhotoIcon } from '@styled-icons/material/Photo'; import { Photo as PhotoIcon } from '@styled-icons/material/Photo';
import fuzzy from 'fuzzy'; import fuzzy from 'fuzzy';
import isEmpty from 'lodash/isEmpty'; import isEmpty from 'lodash/isEmpty';
import trim from 'lodash/trim';
import { dirname, join } from 'path'; import { dirname, join } from 'path';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { translate } from 'react-polyglot'; import { translate } from 'react-polyglot';
@ -298,7 +297,7 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
if (!config) { if (!config) {
return undefined; return undefined;
} }
return trim(selectMediaFolder(config, collection, entry, field), '/'); return selectMediaFolder(config, collection, entry, field);
}, [collection, config, entry, field]); }, [collection, config, entry, field]);
const parentFolder = useMemo(() => { const parentFolder = useMemo(() => {