Skip to content

Commit

Permalink
Merge pull request #2580 from julien-louis/fix-firefox-dl
Browse files Browse the repository at this point in the history
disabled download button on firefox when loading info
  • Loading branch information
pierrehenri-dauvergne authored Jan 15, 2025
2 parents d23afb3 + 0f0b72d commit 4632e19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ input[type="number"] { width: 52px; }

.msg { max-width: 600px; color: blue; line-height: 20px; text-align: left; background-color: lightsteelblue; padding: 10px 20px; border-radius: 2px; }
.msg i { font-size: 20px; color: blue; opacity: 0.5; }
.msg a { cursor: pointer; }
.msg a { cursor: pointer; }

.loading { margin-top: 15px; }
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ <h2 class="header">Download Datasets</h2>
See the list of compatible browsers :
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker#browser_compatibility" target="_blank">https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker#browser_compatibility</a>
</div>
<div *ngIf="loading">
<div class="loading" *ngIf="loading">
<i *ngIf="loading" class="fas fa-cog fa-spin"></i> Retrieving download informations...
</div>
<fieldset class="body" disabled="loading"> <ol>
<fieldset class="body" [disabled]="loading"> <ol>
<li *ngIf="hasDicom">
<label>Dataset files format</label>
<span class="right-col">
Expand All @@ -40,7 +40,7 @@ <h2 class="header">Download Datasets</h2>
</ol>
</fieldset>
<div class="footer">
<button type="button" type="button" (click)="downloadNow()" class="alt left-icon" [disabled]="form.dirty && !form.valid">
<button type="button" type="button" (click)="downloadNow()" class="alt left-icon" [disabled]="loading || (form.dirty && !form.valid)">
<i class="fas fa-download"></i>Download zip
</button>
<button type="button" (click)="cancel()">Cancel</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class MassDownloadService {
}).catch(error => {
if (error == this.BROWSER_COMPAT_ERROR_MSG) {
return this.openAltModal(inputIds).then(ret => {
if (ret != 'cancel') {
if (ret != 'cancel' && ret.datasets) {
return this._downloadAlt(ret.datasets.map(ds => ds.id), ret.format, ret.converter, downloadState).catch(error => {
if (ret.datasets.length > this.datasetService.MAX_DATASETS_IN_ZIP_DL) {
this.dialogService.error('Too many datasets', 'You are trying to download '
Expand Down

0 comments on commit 4632e19

Please sign in to comment.