diff --git a/scripts/development.bash b/scripts/development.bash index 27ae89772..5fbb6cb32 100755 --- a/scripts/development.bash +++ b/scripts/development.bash @@ -1,5 +1,6 @@ #!/bin/bash tmux new-session -d 'npm --prefix server start' +sleep 5 tmux split-window -h 'npm --prefix web start' tmux -2 attach-session -d \ No newline at end of file diff --git a/web/src/pages/Upload/components/DownloadButton.tsx b/web/src/pages/Upload/components/DownloadButton.tsx index b19e44595..c02739751 100644 --- a/web/src/pages/Upload/components/DownloadButton.tsx +++ b/web/src/pages/Upload/components/DownloadButton.tsx @@ -1,4 +1,4 @@ -import { useRef } from 'react'; +import { useEffect, useRef } from 'react'; interface Props { downloadLink: string | undefined; @@ -17,6 +17,14 @@ function DownloadButton(props: Props) { ${isDownloadable ? 'is-primary' : 'is-light'} ${uploading ? 'is-loading' : ''}`; + const isReady = downloadLink && !uploading; + + useEffect(() => { + if (isReady) { + downloadRef.current.click(); + } + }, [isReady, downloadRef]); + return (