Ottimizzazione UI player, rotazione head tilt invertita, prefisso playlist in Home e implementazione Identity QR modal e interceptor API
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);
|
||||
|
||||
/** Identificativo utente univoco per la gestione delle comunità */
|
||||
public userUuid = signal<string>('');
|
||||
|
||||
private wakeLock: any = null;
|
||||
|
||||
// PWA installation signals
|
||||
@@ -63,6 +66,22 @@ export class SettingsService {
|
||||
public isAndroid = signal<boolean>(false);
|
||||
|
||||
constructor() {
|
||||
// Gestione/Generazione ID utente univoco
|
||||
let savedUuid = localStorage.getItem('user-uuid');
|
||||
if (!savedUuid) {
|
||||
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
||||
savedUuid = crypto.randomUUID();
|
||||
} else {
|
||||
savedUuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
||||
const r = Math.random() * 16 | 0;
|
||||
const v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
localStorage.setItem('user-uuid', savedUuid);
|
||||
}
|
||||
this.userUuid.set(savedUuid);
|
||||
|
||||
// Detect PWA status
|
||||
try {
|
||||
this.isStandalone.set(
|
||||
@@ -117,6 +136,7 @@ export class SettingsService {
|
||||
localStorage.setItem(migrationKey, 'true');
|
||||
}
|
||||
|
||||
|
||||
const savedChords = localStorage.getItem('show-chords-default');
|
||||
if (savedChords !== null) {
|
||||
this.showChordsDefault.set(savedChords === 'true');
|
||||
@@ -397,6 +417,14 @@ export class SettingsService {
|
||||
this.chordNotationPreference.set(val);
|
||||
}
|
||||
|
||||
setUserUuid(uuid: string) {
|
||||
const trimmed = uuid.trim();
|
||||
if (trimmed) {
|
||||
this.userUuid.set(trimmed);
|
||||
localStorage.setItem('user-uuid', trimmed);
|
||||
}
|
||||
}
|
||||
|
||||
async installPwa() {
|
||||
const promptEvent = this.deferredPrompt();
|
||||
if (!promptEvent) {
|
||||
|
||||
Reference in New Issue
Block a user