Skip to content

Commit 734046c

Browse files
authored
Hotfix downloading a package zip (#4634)
1 parent 3d7400b commit 734046c

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

catalog/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ where verb is one of
1818

1919
## Changes
2020

21+
- [Fixed] Prevent package download form from being prematurely removed from DOM ([#4634](https://github.com/quiltdata/quilt/pull/4634))
2122
- [Fixed] Remove leading slash when creating a file from the root directory ([#4631](https://github.com/quiltdata/quilt/pull/4631))
2223
- [Fixed] Remove leading slash from code samples for downloading an S3 directory ([#4631](https://github.com/quiltdata/quilt/pull/4631))
2324
- [Fixed] Handle invalid URLs in Markdown gracefully ([#4630](https://github.com/quiltdata/quilt/pull/4630))

catalog/app/containers/Bucket/Dir/Toolbar/Get/Options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function DownloadDir({ dirHandle }: DownloadDirProps) {
5252
event.stopPropagation()
5353
setDownloading(true)
5454
}}
55-
startIcon={downloading ? <M.CircularProgress size={20} /> : undefined}
55+
{...(downloading ? { startIcon: <M.CircularProgress size={20} /> } : null)}
5656
>
5757
Download ZIP (directory)
5858
</Buttons.DownloadDir>

catalog/app/containers/Bucket/Download/PackageOptions.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,21 @@ function DownloadDir({ selection, uri }: DownloadDirProps) {
3838
() => selection && Selection.toHandlesList(selection),
3939
[selection],
4040
)
41+
const [downloading, setDownloading] = React.useState(false)
42+
React.useEffect(() => {
43+
if (!downloading) return
44+
setTimeout(() => setDownloading(false), 1000)
45+
}, [downloading])
4146
return (
42-
<Buttons.DownloadDir suffix={downloadPath} fileHandles={fileHandles}>
47+
<Buttons.DownloadDir
48+
suffix={downloadPath}
49+
fileHandles={fileHandles}
50+
onClick={(event) => {
51+
event.stopPropagation()
52+
setDownloading(true)
53+
}}
54+
{...(downloading ? { startIcon: <M.CircularProgress size={20} /> } : null)}
55+
>
4356
{downloadLabel}
4457
</Buttons.DownloadDir>
4558
)

0 commit comments

Comments
 (0)