feat: show instructions when playlist is empty & fix high contrast contrast
This commit is contained in:
@@ -56,6 +56,12 @@ export class SettingsService {
|
||||
/** Identificativo utente univoco per la gestione delle comunità */
|
||||
public userUuid = signal<string>('');
|
||||
|
||||
/** Identificativo originario assegnato alla prima installazione */
|
||||
public originalUserUuid = signal<string>('');
|
||||
|
||||
/** Nome associato all'identità utente */
|
||||
public userName = signal<string>('');
|
||||
|
||||
private wakeLock: any = null;
|
||||
|
||||
// PWA installation signals
|
||||
@@ -83,6 +89,19 @@ export class SettingsService {
|
||||
}
|
||||
this.userUuid.set(savedUuid);
|
||||
|
||||
// Salvataggio dell'ID originario (alla prima installazione) se non è già presente
|
||||
let originalUuid = localStorage.getItem('original-user-uuid');
|
||||
if (!originalUuid) {
|
||||
originalUuid = savedUuid;
|
||||
localStorage.setItem('original-user-uuid', originalUuid);
|
||||
}
|
||||
this.originalUserUuid.set(originalUuid);
|
||||
|
||||
const savedName = localStorage.getItem('user-name');
|
||||
if (savedName) {
|
||||
this.userName.set(savedName);
|
||||
}
|
||||
|
||||
// Detect PWA status
|
||||
try {
|
||||
this.isStandalone.set(
|
||||
@@ -166,12 +185,8 @@ export class SettingsService {
|
||||
this.autoAdvance.set(true);
|
||||
}
|
||||
|
||||
const savedKeepScreenOn = localStorage.getItem('keep-screen-on');
|
||||
if (savedKeepScreenOn !== null) {
|
||||
this.keepScreenOn.set(savedKeepScreenOn === 'true');
|
||||
} else {
|
||||
this.keepScreenOn.set(true);
|
||||
}
|
||||
// Keep screen always on by default and always active
|
||||
this.keepScreenOn.set(true);
|
||||
|
||||
const savedComunitaEnabled = localStorage.getItem('comunita-enabled');
|
||||
if (savedComunitaEnabled !== null) {
|
||||
@@ -318,9 +333,6 @@ export class SettingsService {
|
||||
localStorage.setItem('show-editor', newValue.toString());
|
||||
}
|
||||
|
||||
toggleKeepScreenOn() {
|
||||
this.keepScreenOn.update(v => !v);
|
||||
}
|
||||
|
||||
toggleComunitaEnabled() {
|
||||
const newValue = !this.comunitaEnabled();
|
||||
@@ -426,6 +438,12 @@ export class SettingsService {
|
||||
}
|
||||
}
|
||||
|
||||
setUserName(name: string) {
|
||||
const trimmed = name.trim();
|
||||
this.userName.set(trimmed);
|
||||
localStorage.setItem('user-name', trimmed);
|
||||
}
|
||||
|
||||
async installPwa() {
|
||||
const promptEvent = this.deferredPrompt();
|
||||
if (!promptEvent) {
|
||||
|
||||
Reference in New Issue
Block a user