diff --git a/src/app/components/floating-column/settings/settings.component.html b/src/app/components/floating-column/settings/settings.component.html index 311f9e0a..37d9a4be 100644 --- a/src/app/components/floating-column/settings/settings.component.html +++ b/src/app/components/floating-column/settings/settings.component.html @@ -55,7 +55,11 @@

About

-

Sengi version: {{version}}

+

+ Sengi version: {{version}}
+ check for updates +

+

RESET

diff --git a/src/app/components/floating-column/settings/settings.component.scss b/src/app/components/floating-column/settings/settings.component.scss index 173c69fc..b2540c13 100644 --- a/src/app/components/floating-column/settings/settings.component.scss +++ b/src/app/components/floating-column/settings/settings.component.scss @@ -17,6 +17,14 @@ .version { display: block; padding: 0 5px; + + &__link { + color: rgb(161, 161, 161); + + &:hover { + color: #fff; + } + } } .sub-section { diff --git a/src/app/components/floating-column/settings/settings.component.ts b/src/app/components/floating-column/settings/settings.component.ts index 6cc9ea15..c74e1ce7 100644 --- a/src/app/components/floating-column/settings/settings.component.ts +++ b/src/app/components/floating-column/settings/settings.component.ts @@ -5,6 +5,7 @@ import { Howl } from 'howler'; import { environment } from '../../../../environments/environment'; import { ToolsService } from '../../../services/tools.service'; import { UserNotificationService, NotificationSoundDefinition } from '../../../services/user-notification.service'; +import { ServiceWorkerService } from '../../../services/service-worker.service'; @Component({ selector: 'app-settings', @@ -28,6 +29,7 @@ export class SettingsComponent implements OnInit { constructor( private formBuilder: FormBuilder, + private serviceWorkersService: ServiceWorkerService, private readonly toolsService: ToolsService, private readonly userNotificationsService: UserNotificationService) { } @@ -119,6 +121,11 @@ export class SettingsComponent implements OnInit { this.isCleanningAll = false; return false; } + + checkForUpdates(): boolean { + this.serviceWorkersService.checkForUpdates(); + return false; + } } diff --git a/src/app/services/service-worker.service.ts b/src/app/services/service-worker.service.ts index 2c2ab0f9..7e0f57dd 100644 --- a/src/app/services/service-worker.service.ts +++ b/src/app/services/service-worker.service.ts @@ -7,12 +7,11 @@ import { interval, concat, BehaviorSubject } from 'rxjs'; providedIn: 'root' }) export class ServiceWorkerService { - newAppVersionIsAvailable = new BehaviorSubject(false); private isListening = false; - constructor(appRef: ApplicationRef, updates: SwUpdate) { + constructor(appRef: ApplicationRef, private updates: SwUpdate) { //https://angular.io/guide/service-worker-communications @@ -46,4 +45,12 @@ export class ServiceWorkerService { loadNewAppVersion() { document.location.reload(); } + + checkForUpdates(): any { + console.log("Check for update"); + this.updates.checkForUpdate() + .catch(err => { + console.error(err); + }); + } } \ No newline at end of file