- sistemazioni Email : registrazione, invio invito, email di benvenuto
- fix circuito - profilo
This commit is contained in:
@@ -2720,7 +2720,7 @@ export const tools = {
|
||||
|
||||
getUserEmail() {
|
||||
const userStore = useUserStore();
|
||||
return userStore.my?.email;
|
||||
return userStore.my?.email.trim();
|
||||
},
|
||||
|
||||
getEmailSupport() {
|
||||
@@ -6375,6 +6375,32 @@ export const tools = {
|
||||
});
|
||||
});
|
||||
},
|
||||
deleteUser($q: any, username: string, usernameDest: string) {
|
||||
// Segnala Profilo
|
||||
const userStore = useUserStore();
|
||||
//T_TOLTO
|
||||
$q.dialog({
|
||||
message: t('db.domanda_deleteuser', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda'),
|
||||
}).onOk(() => {
|
||||
userStore
|
||||
.setFriendsCmd(
|
||||
$q,
|
||||
t,
|
||||
username,
|
||||
usernameDest,
|
||||
shared_consts.FRIENDSCMD.DELETE_USER,
|
||||
null
|
||||
)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('db.deleteduser'));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
verifyUser($q: any, username: string, usernameDest: string) {
|
||||
// Segnala Profilo
|
||||
@@ -11282,31 +11308,73 @@ export const tools = {
|
||||
.toLowerCase()
|
||||
: undefined;
|
||||
},
|
||||
isInTelegramWebView() {
|
||||
try {
|
||||
// Verifica che siamo lato client
|
||||
if (typeof window === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
isInTelegramWebView(): boolean {
|
||||
const ua = (navigator.userAgent || '').toLowerCase();
|
||||
|
||||
// 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;
|
||||
// Controlla user agent
|
||||
if (ua.includes('telegram')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Controlla oggetti globali Telegram
|
||||
const win = window as any;
|
||||
if (win.Telegram || win.TelegramWebviewProxy || win.TelegramWebApp) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
isInAppBrowser(): boolean {
|
||||
const ua = (
|
||||
navigator.userAgent ||
|
||||
navigator.vendor ||
|
||||
(window as any).opera ||
|
||||
''
|
||||
).toLowerCase();
|
||||
|
||||
// Telegram specifico
|
||||
if (this.isInTelegramWebView()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Altri in-app browser
|
||||
const inAppPatterns = [
|
||||
'fbav',
|
||||
'fban', // Facebook
|
||||
'instagram', // Instagram
|
||||
'tiktok', // TikTok
|
||||
'snapchat', // Snapchat
|
||||
'twitter', // Twitter
|
||||
'line', // Line
|
||||
'micromessenger', // WeChat
|
||||
];
|
||||
|
||||
if (inAppPatterns.some((pattern) => ua.includes(pattern))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Android WebView
|
||||
if (ua.includes('wv') && ua.includes('android')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// iOS WebView (esclude Safari/Chrome/Firefox nativi)
|
||||
if (/iphone|ipad|ipod/.test(ua)) {
|
||||
const isSafari = /safari/.test(ua) && !/crios|fxios|edgios/.test(ua);
|
||||
if (!isSafari) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
isStatusNonAutorizzato() {
|
||||
const userStore = useUserStore();
|
||||
return userStore.servercode === serv_constants.RIS_CODE__HTTP_FORBIDDEN_PERMESSI
|
||||
},
|
||||
|
||||
pageExist(path: string) {
|
||||
const globalStore = useGlobalStore();
|
||||
const page = globalStore.getPage(path);
|
||||
|
||||
Reference in New Issue
Block a user