mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Clickable folder link after download
This commit is contained in:
@@ -20,7 +20,10 @@
|
||||
Download Anyway
|
||||
</button>
|
||||
<div class="header">{{download.header}}</div>
|
||||
<div class="description">{{download.description}}</div>
|
||||
<div *ngIf="download.type != 'done'" class="description">{{download.description}}</div>
|
||||
<div *ngIf="download.type == 'done'" class="description">
|
||||
<a (click)="openFolder(download.description)">{{download.description}}</a>
|
||||
</div>
|
||||
<div appProgressBar [percent]="download.percent" class="ui progress">
|
||||
<div class="bar">
|
||||
<div class="progress"></div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, ChangeDetectorRef } from '@angular/core'
|
||||
import { DownloadProgress } from '../../../../../electron/shared/interfaces/download.interface'
|
||||
import { DownloadService } from '../../../../core/services/download.service'
|
||||
import { ElectronService } from 'src/app/core/services/electron.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-downloads-modal',
|
||||
@@ -11,7 +12,7 @@ export class DownloadsModalComponent {
|
||||
|
||||
downloads: DownloadProgress[] = []
|
||||
|
||||
constructor(private downloadService: DownloadService, ref: ChangeDetectorRef) {
|
||||
constructor(private electronService: ElectronService, private downloadService: DownloadService, ref: ChangeDetectorRef) {
|
||||
downloadService.onDownloadUpdated(download => {
|
||||
const index = this.downloads.findIndex(thisDownload => thisDownload.versionID == download.versionID)
|
||||
if (index == -1) {
|
||||
@@ -45,8 +46,13 @@ export class DownloadsModalComponent {
|
||||
getBackgroundColor(download: DownloadProgress) {
|
||||
switch(download.type) {
|
||||
case 'good': return 'unset'
|
||||
case 'done': return 'unset'
|
||||
case 'warning': return 'yellow'
|
||||
case 'error': return 'indianred'
|
||||
}
|
||||
}
|
||||
|
||||
openFolder(filepath: string) {
|
||||
this.electronService.sendIPC('open-folder', filepath)
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ export class DownloadService {
|
||||
}
|
||||
|
||||
addDownload(versionID: number, newDownload: NewDownload) {
|
||||
if (this.downloads.findIndex(download => download.versionID == versionID) != -1) { return } // Don't download something twice
|
||||
this.electronService.receiveIPC('download-updated', result => {
|
||||
this.downloadUpdatedEmitter.emit(result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user