About dialog now informs user when update is available or when they are up to date based on the github release api

This commit is contained in:
Isaac Grynsztein
2020-03-25 07:39:39 -04:00
parent d0221f2233
commit 72b42dea5a
3 changed files with 32 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { PostsService } from 'app/posts.services';
@Component({
selector: 'app-about-dialog',
@@ -10,12 +11,23 @@ export class AboutDialogComponent implements OnInit {
projectLink = 'https://github.com/Tzahi12345/YoutubeDL-Material';
issuesLink = 'https://github.com/Tzahi12345/YoutubeDL-Material/issues';
latestUpdateLink = 'https://github.com/Tzahi12345/YoutubeDL-Material/releases/latest'
latestGithubRelease = null;
checking_for_updates = true;
version = 'v3.5';
current_version_tag = 'v3.5';
constructor() { }
constructor(private postsService: PostsService) { }
ngOnInit(): void {
this.getLatestGithubRelease()
}
getLatestGithubRelease() {
this.postsService.getLatestGithubRelease().subscribe(res => {
this.checking_for_updates = false;
this.latestGithubRelease = res;
console.log(this.latestGithubRelease)
});
}
}