- asggiunto bottone "installa app" sulla email di conferma registrazione e anche la Guida "/guida".

- migliorato InvitaAmico
This commit is contained in:
Surya Paolo
2025-11-19 11:39:36 +01:00
parent 05a3617103
commit 57436f088b
25 changed files with 270 additions and 113 deletions

View File

@@ -165,11 +165,10 @@ export const Api = {
} else {
// Se il refresh token fallisce, logout dell'utente
// userStore.setAuth('', '');
const $router = useRouter();
throw { code: toolsext.ERR_RETRY_LOGIN };
}
} catch (err2) {
console.error('Errore durante il refresh token:', err2);
console.error('Errore durante il check Token Scaduto:', err2);
let mystatus = err2?.code || err2?.status;
@@ -192,7 +191,6 @@ export const Api = {
// || statuscode2 === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN
) {
userStore.setAuth('', '');
const $router = useRouter();
throw { status: toolsext.ERR_RETRY_LOGIN };
}

View File

@@ -2726,7 +2726,7 @@ export const tools = {
getEmailSupport() {
const globalStore = useGlobalStore();
const site = globalStore.site;
return this.getemailto(site?.contacts.email)
return this.getemailto(site?.contacts.email);
},
visumenu(elem: IListRoutes) {
@@ -5651,9 +5651,9 @@ export const tools = {
const globalStore = useGlobalStore();
const site = globalStore.site;
if (tools.isTest() && !import.meta.env.DEV) {
mylink = 'https://t.me/' + site.telegram_bot_name_test
mylink = 'https://t.me/' + site.telegram_bot_name_test;
} else {
mylink = 'https://t.me/' + site.telegram_bot_name
mylink = 'https://t.me/' + site.telegram_bot_name;
}
let add = '';
@@ -6397,7 +6397,7 @@ export const tools = {
)
.then((res: any) => {
if (res) {
tools.showPositiveNotif($q, t('db.trusted', {username: usernameDest}));
tools.showPositiveNotif($q, t('db.trusted', { username: usernameDest }));
}
});
});
@@ -11273,21 +11273,37 @@ export const tools = {
.toLowerCase()
: undefined;
},
isInTelegramWebView() {
try {
return /Telegram/.test(navigator.userAgent);
// Verifica che siamo lato client
if (typeof window === 'undefined') {
return false;
}
// Metodo 1: Controlla oggetti globali di Telegram
const win = window as any;
if (win.Telegram || win.TelegramWebviewProxy || win.TelegramWebApp) {
return true;
}
// Metodo 2: User Agent (case-insensitive)
const ua = navigator.userAgent.toLowerCase();
if (ua.includes('telegram')) {
return true;
}
return false;
} catch (e) {
console.error('Errore rilevamento Telegram:', e);
return false;
}
},
pageExist(path: string) {
const globalStore = useGlobalStore();
const page = globalStore.getPage(path)
const page = globalStore.getPage(path);
return !!page
}
return !!page;
},
// FINE !