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