Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloads: added snap store link #152

Merged
merged 1 commit into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!');
}
}