Salvataggio modifiche correnti prima di implementare condivisione canto
This commit is contained in:
@@ -53,6 +53,9 @@ export class SettingsService {
|
||||
/** Avanzamento a pagine del karaoke manuale: true = i tasti next/prev voltano la pagina */
|
||||
public karaokePageScrollMode = signal<boolean>(false);
|
||||
|
||||
/** Vista orizzontale per proiezione: true = attiva layout landscape per proiezione */
|
||||
public landscapeProjectionEnabled = signal<boolean>(true);
|
||||
|
||||
/** Identificativo utente univoco per la gestione delle comunità */
|
||||
public userUuid = signal<string>('');
|
||||
|
||||
@@ -244,6 +247,13 @@ export class SettingsService {
|
||||
this.karaokePageScrollMode.set(false);
|
||||
}
|
||||
|
||||
const savedLandscapeProjectionEnabled = localStorage.getItem('landscape-projection-enabled');
|
||||
if (savedLandscapeProjectionEnabled !== null) {
|
||||
this.landscapeProjectionEnabled.set(savedLandscapeProjectionEnabled === 'true');
|
||||
} else {
|
||||
this.landscapeProjectionEnabled.set(true);
|
||||
}
|
||||
|
||||
// Sync browser fullscreen state with listeners (supporting vendor prefixes)
|
||||
const updateFullscreenState = () => {
|
||||
const isFs = !!(
|
||||
@@ -297,6 +307,10 @@ export class SettingsService {
|
||||
localStorage.setItem('karaoke-page-scroll-mode', this.karaokePageScrollMode().toString());
|
||||
});
|
||||
|
||||
effect(() => {
|
||||
localStorage.setItem('landscape-projection-enabled', this.landscapeProjectionEnabled().toString());
|
||||
});
|
||||
|
||||
effect(() => {
|
||||
const active = this.keepScreenOn();
|
||||
localStorage.setItem('keep-screen-on', active.toString());
|
||||
@@ -426,6 +440,12 @@ export class SettingsService {
|
||||
localStorage.setItem('karaoke-page-scroll-mode', newValue.toString());
|
||||
}
|
||||
|
||||
toggleLandscapeProjectionEnabled() {
|
||||
const newValue = !this.landscapeProjectionEnabled();
|
||||
this.landscapeProjectionEnabled.set(newValue);
|
||||
localStorage.setItem('landscape-projection-enabled', newValue.toString());
|
||||
}
|
||||
|
||||
setChordNotationPreference(val: 'diesis' | 'bemolle') {
|
||||
this.chordNotationPreference.set(val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user