mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Move isSng control to settings page
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@angular/core'
|
||||
import { FormControl } from '@angular/forms'
|
||||
|
||||
import { capitalize } from 'lodash'
|
||||
import { SettingsService } from 'src-angular/app/core/services/settings.service'
|
||||
@@ -11,6 +12,8 @@ import { themes } from 'src-shared/Settings'
|
||||
export class SettingsComponent implements OnInit {
|
||||
@ViewChild('themeDropdown', { static: true }) themeDropdown: ElementRef
|
||||
|
||||
public isSng: FormControl<boolean>
|
||||
|
||||
updateAvailable: boolean | null = false
|
||||
loginClicked = false
|
||||
downloadUpdateText = 'Update available'
|
||||
@@ -23,7 +26,10 @@ export class SettingsComponent implements OnInit {
|
||||
constructor(
|
||||
public settingsService: SettingsService,
|
||||
private ref: ChangeDetectorRef
|
||||
) { }
|
||||
) {
|
||||
this.isSng = new FormControl<boolean>(settingsService.isSng, { nonNullable: true })
|
||||
this.isSng.valueChanges.subscribe(value => settingsService.isSng = value)
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
window.electron.on.updateAvailable(result => {
|
||||
@@ -73,6 +79,10 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
openUrl(url: string) {
|
||||
window.electron.emit.openUrl(url)
|
||||
}
|
||||
|
||||
setTheme(theme: typeof themes[number]) {
|
||||
this.settingsService.theme = theme
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user