added check updates link
This commit is contained in:
parent
4d461b497e
commit
b17f2742a4
|
@ -58,6 +58,7 @@
|
|||
<p class="version">
|
||||
Sengi version: {{version}}<br/>
|
||||
<a href class="version__link" (click)="checkForUpdates()">check for updates</a>
|
||||
<app-waiting-animation *ngIf="isCheckingUpdates" class="waiting-icon"></app-waiting-animation>
|
||||
</p>
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import { ServiceWorkerService } from '../../../services/service-worker.service';
|
|||
})
|
||||
|
||||
export class SettingsComponent implements OnInit {
|
||||
|
||||
|
||||
notificationSounds: NotificationSoundDefinition[];
|
||||
notificationSoundId: string;
|
||||
notificationForm: FormGroup;
|
||||
|
@ -36,7 +36,7 @@ export class SettingsComponent implements OnInit {
|
|||
ngOnInit() {
|
||||
this.version = environment.VERSION;
|
||||
|
||||
const settings = this.toolsService.getSettings();
|
||||
const settings = this.toolsService.getSettings();
|
||||
|
||||
this.notificationSounds = this.userNotificationsService.getAllNotificationSounds();
|
||||
this.notificationSoundId = settings.notificationSoundFileId;
|
||||
|
@ -48,18 +48,18 @@ export class SettingsComponent implements OnInit {
|
|||
this.disableAvatarNotificationsEnabled = settings.disableAvatarNotifications;
|
||||
this.disableSoundsEnabled = settings.disableSounds;
|
||||
|
||||
if(!settings.columnSwitchingWinAlt){
|
||||
if (!settings.columnSwitchingWinAlt) {
|
||||
this.columnShortcutEnabled = ColumnShortcut.Ctrl;
|
||||
} else {
|
||||
this.columnShortcutEnabled = ColumnShortcut.Win;
|
||||
}
|
||||
}
|
||||
|
||||
onShortcutChange(id: ColumnShortcut){
|
||||
onShortcutChange(id: ColumnShortcut) {
|
||||
this.columnShortcutEnabled = id;
|
||||
this.columnShortcutChanged = true;
|
||||
|
||||
let settings = this.toolsService.getSettings()
|
||||
let settings = this.toolsService.getSettings()
|
||||
settings.columnSwitchingWinAlt = id === ColumnShortcut.Win;
|
||||
this.toolsService.saveSettings(settings);
|
||||
}
|
||||
|
@ -87,19 +87,19 @@ export class SettingsComponent implements OnInit {
|
|||
return false;
|
||||
}
|
||||
|
||||
onDisableAutofocusChanged(){
|
||||
onDisableAutofocusChanged() {
|
||||
let settings = this.toolsService.getSettings();
|
||||
settings.disableAutofocus = this.disableAutofocusEnabled;
|
||||
this.toolsService.saveSettings(settings);
|
||||
this.toolsService.saveSettings(settings);
|
||||
}
|
||||
|
||||
onDisableAvatarNotificationsChanged(){
|
||||
onDisableAvatarNotificationsChanged() {
|
||||
let settings = this.toolsService.getSettings();
|
||||
settings.disableAvatarNotifications = this.disableAvatarNotificationsEnabled;
|
||||
this.toolsService.saveSettings(settings);
|
||||
}
|
||||
|
||||
onDisableSoundsEnabledChanged(){
|
||||
onDisableSoundsEnabledChanged() {
|
||||
let settings = this.toolsService.getSettings();
|
||||
settings.disableSounds = this.disableSoundsEnabled;
|
||||
this.toolsService.saveSettings(settings);
|
||||
|
@ -111,7 +111,7 @@ export class SettingsComponent implements OnInit {
|
|||
return false;
|
||||
}
|
||||
|
||||
confirmClearAll(): boolean{
|
||||
confirmClearAll(): boolean {
|
||||
localStorage.clear();
|
||||
location.reload();
|
||||
return false;
|
||||
|
@ -122,14 +122,22 @@ export class SettingsComponent implements OnInit {
|
|||
return false;
|
||||
}
|
||||
|
||||
isCheckingUpdates = false;
|
||||
checkForUpdates(): boolean {
|
||||
this.serviceWorkersService.checkForUpdates();
|
||||
this.isCheckingUpdates = true;
|
||||
this.serviceWorkersService.checkForUpdates()
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
})
|
||||
.then(() => {
|
||||
this.isCheckingUpdates = false;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum ColumnShortcut {
|
||||
Ctrl = 1,
|
||||
Ctrl = 1,
|
||||
Win = 2
|
||||
}
|
|
@ -46,11 +46,7 @@ export class ServiceWorkerService {
|
|||
document.location.reload();
|
||||
}
|
||||
|
||||
checkForUpdates(): any {
|
||||
console.log("Check for update");
|
||||
this.updates.checkForUpdate()
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
checkForUpdates(): Promise<void> {
|
||||
return this.updates.checkForUpdate();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue