Skip to content

Commit

Permalink
added snap store link
Browse files Browse the repository at this point in the history
  • Loading branch information
weblue committed May 8, 2020
1 parent aa4dd0e commit 96f0480
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
25 changes: 25 additions & 0 deletions src/app/components/content/app-downloads/downloads.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@ <h4>
</mat-card-actions>
</mat-card>
</div>
<div class="card-container" fxFlex="1 1 50%" fxFlex.lt-md="1 1 100%" *ngIf="selectedOperatingSystem == 'Linux'">
<mat-card class="mat-elevation-z3" fxFlex="1 1 auto">
<mat-card-header>
<mat-card-title>
Native Launcher with Snap
</mat-card-title>
</mat-card-header>
<mat-card-content>
<h4>
&nbsp;
</h4>
<p>
Linux users have the option of installing the native launcher in a convenient Snap package!
All the benefits of the native launcher, straight from the Canonical store.
</p>
</mat-card-content>
<mat-card-actions>
<a mat-raised-button="mat-raised-button" color="primary" rel="noopener noreferrer"
[href]="getDownload(2)" target="_blank"
(click)="downloadClick(2)">
Open Snap Store
</a>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
Expand Down
18 changes: 12 additions & 6 deletions src/app/components/content/app-downloads/downloads.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class AppDownloadsComponent implements OnInit, OnDestroy {
const baseUrl = `https://github.com/open-osrs/launcher/releases/latest/download`;
if (item === 1) {
return `${baseUrl}/OpenOSRS.jar`;
} else {
} else if (item === 0) {
if (this.selectedOperatingSystem === 'Windows x64') {
return `${baseUrl}/OpenOSRSSetup64.exe`;
} else if (this.selectedOperatingSystem === 'Windows x32') {
Expand All @@ -112,17 +112,23 @@ export class AppDownloadsComponent implements OnInit, OnDestroy {
} else if (this.selectedOperatingSystem === 'Linux') {
return `${baseUrl}/OpenOSRS.AppImage`;
}
} else if (item === 2) {
return `https://snapcraft.io/openosrs`;
}
}

public downloadClick(item: number): void {
this.selectedDownload = item;

this.stepper.selected.completed = true;
this.stepper.next();

this.hideHashes = false;
if (item === 2) {
this.hideHashes = true;
this.notificationService.showError('Opening snapcrafters, please wait!');
} else {
this.hideHashes = false;
this.notificationService.showError('Starting download, please wait!');
this.stepper.selected.completed = true;
this.stepper.next();
}

this.notificationService.showError('Starting download, please wait!');
}
}

0 comments on commit 96f0480

Please sign in to comment.