From 3a001da691c8ed9368761ad7d901ec802dd0fcf0 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 12 May 2023 10:47:38 +0200 Subject: [PATCH] :sparkles: test --- .../Components/DesignSystem/DepositDocument/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index 2a85bbfa..d01afe40 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -69,6 +69,7 @@ export default class DepositDocument extends React.Component { } public override render(): JSX.Element { + console.log("Loading :" , this.state.loading); return (
{ } private async addFile(file: File) { + this.setState({ + loading: true, + }); const formData = new FormData(); formData.append("file", file, file.name); const query = JSON.stringify({ document: { uid: this.props.document.uid } }); formData.append("q", query); - this.setState({ - loading: true, - }); + const newFile = await Files.getInstance().post(formData); const files = this.state.currentFiles ? [...this.state.currentFiles, newFile] : [newFile]; @@ -333,6 +335,9 @@ export default class DepositDocument extends React.Component { } private async onFileChange() { + this.setState({ + loading: true, + }); if (!this.inputRef.current) return; const files = this.inputRef.current.files; if (!files) return;