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:
@@ -26,16 +26,12 @@ export class SearchService {
|
||||
public availableIcons: string[]
|
||||
|
||||
public searchControl = new FormControl('', { nonNullable: true })
|
||||
public isSng: FormControl<boolean>
|
||||
public instrument: FormControl<Instrument | null>
|
||||
public difficulty: FormControl<Difficulty | null>
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
) {
|
||||
this.isSng = new FormControl<boolean>((localStorage.getItem('isSng') ?? 'true') === 'true', { nonNullable: true })
|
||||
this.isSng.valueChanges.subscribe(isSng => localStorage.setItem('isSng', `${isSng}`))
|
||||
|
||||
this.instrument = new FormControl<Instrument>(
|
||||
(localStorage.getItem('instrument') === 'null' ? null : localStorage.getItem('instrument')) as Instrument
|
||||
)
|
||||
|
||||
@@ -75,11 +75,11 @@ export class SettingsService {
|
||||
this.saveSettings()
|
||||
}
|
||||
|
||||
get rateLimitDelay() {
|
||||
return this.settings.rateLimitDelay
|
||||
get isSng() {
|
||||
return this.settings.isSng
|
||||
}
|
||||
set rateLimitDelay(delay: number) {
|
||||
this.settings.rateLimitDelay = delay
|
||||
set isSng(value: boolean) {
|
||||
this.settings.isSng = value
|
||||
this.saveSettings()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user