Improve download UI

This commit is contained in:
Geomitron
2024-07-11 18:29:34 -05:00
parent 2d9fad5d03
commit 2e08dec589
6 changed files with 62 additions and 16 deletions

View File

@@ -18,6 +18,7 @@ export class ChartSidebarComponent implements OnInit {
@HostBinding('class.contents') contents = true
@ViewChild('menu') menu: ElementRef
@ViewChild('libraryDirectoryErrorModal') libraryDirectoryErrorModal: ElementRef<HTMLDialogElement>
public shortInstrumentDisplay = shortInstrumentDisplay
public difficultyDisplay = difficultyDisplay
@@ -281,7 +282,11 @@ export class ChartSidebarComponent implements OnInit {
* Adds the selected chart to the download queue.
*/
onDownloadClicked() {
this.downloadService.addDownload(this.selectedChart!)
if (this.settingsService.libraryDirectory) {
this.downloadService.addDownload(this.selectedChart!)
} else {
this.libraryDirectoryErrorModal.nativeElement.showModal()
}
}
public showMenu() {