This commit is contained in:
Matthew Penner 2020-08-24 11:26:05 -06:00
parent 1e58e108ba
commit 773c42e4f2
3 changed files with 4 additions and 3 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

View file

@ -45,7 +45,7 @@ export default ({ withinFileEditor, isNewFile }: Props) => {
return ( return (
<div css={tw`flex items-center text-sm mb-4 text-neutral-500`}> <div css={tw`flex items-center text-sm mb-4 text-neutral-500`}>
{(files && files.length && !params?.action) && {(files && files.length > 0 && !params?.action) &&
<FileActionCheckbox <FileActionCheckbox
type={'checkbox'} type={'checkbox'}
css={tw`mx-4`} css={tw`mx-4`}

View file

@ -11,6 +11,7 @@ import useEventListener from '@/plugins/useEventListener';
import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
import useFlash from '@/plugins/useFlash'; import useFlash from '@/plugins/useFlash';
import useFileManagerSwr from '@/plugins/useFileManagerSwr'; import useFileManagerSwr from '@/plugins/useFileManagerSwr';
import { ServerContext } from '@/state/server';
const InnerContainer = styled.div` const InnerContainer = styled.div`
max-width: 600px; max-width: 600px;
@ -23,6 +24,7 @@ export default () => {
const [ loading, setLoading ] = useState(false); const [ loading, setLoading ] = useState(false);
const { mutate } = useFileManagerSwr(); const { mutate } = useFileManagerSwr();
const { clearFlashes, clearAndAddHttpError } = useFlash(); const { clearFlashes, clearAndAddHttpError } = useFlash();
const directory = ServerContext.useStoreState(state => state.files.directory);
useEventListener('dragenter', e => { useEventListener('dragenter', e => {
e.stopPropagation(); e.stopPropagation();
@ -60,7 +62,7 @@ export default () => {
setLoading(true); setLoading(true);
clearFlashes('files'); clearFlashes('files');
getFileUploadUrl(uuid) getFileUploadUrl(uuid)
.then(url => axios.post(url, form, { .then(url => axios.post(`${url}&directory=${directory}`, form, {
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },