commit ad652b5eea3a6675d156ab6ccebf71f678d83034 parent b5531e3f7beb0c6cc51fd99c27bd3adde159cac4 Author: MTRNord <mtrnord1@gmail.com> Date: Tue, 25 Jan 2022 14:48:41 +0100 Prepare upload Diffstat:
| M | components/submit_page/main.tsx | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/components/submit_page/main.tsx b/components/submit_page/main.tsx @@ -98,6 +98,17 @@ class MainSubmissionForm extends PureComponent<Props, State> { } } + private async doUpload() { + const urls = []; + if (!this.context.client.isGuest) { + for (const file of this.props.files) { + const result = this.context.client.uploadFile(file); + urls.push({ file_name: file.name, url: result }); + } + } + return urls; + } + handleInputChange(event: { target: any; }) { const target = event.target; const value = target.type === 'checkbox' ? target.checked : target.value;