- corretto problema ROGNOSO : Risolvere la questione "Sessioni multiple", se apro 2 browser l'ultimo va a cancellare il precedente, e mi da errore di email non valida !
Il problema era sulla fetch nel service worker, gestita in quel modo personalizzato, andava in conflitto, non tenendo le chiamate bloccanti, ma uscivano prima che arrivasse la risposta del server. - Per chi è da tanto che non si collega a RISO, compare "Email non verificata"... (si risolve chiudendo su ESCI e riloggandosi)... però andrebbe sistemata. (stesso problema di prima).
This commit is contained in:
@@ -1,69 +1,67 @@
|
||||
import { defineComponent, ref, computed, PropType, toRef, onMounted } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { tools } from '@tools'
|
||||
import { costanti, IMainCard } from '@store/Modules/costanti'
|
||||
import { CBigBtn } from '@src/components/CBigBtn'
|
||||
|
||||
import { defineComponent, ref, computed, onMounted } from 'vue';
|
||||
import { useGlobalStore } from '@store/globalStore';
|
||||
import { tools } from '@tools';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CCheckAppRunning',
|
||||
components: { CBigBtn },
|
||||
props: {},
|
||||
setup(props, { emit }) {
|
||||
setup() {
|
||||
const globalStore = useGlobalStore();
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $router = useRouter()
|
||||
const globalStore = useGlobalStore()
|
||||
const { t } = useI18n()
|
||||
const isAppRunning = computed(() => globalStore.isAppRunning === true);
|
||||
const finishLoading = computed(() => globalStore.finishLoading === true);
|
||||
const deferredPrompt = computed(() => globalStore.deferredPrompt);
|
||||
const homescreen = computed(() => globalStore.homescreen === true);
|
||||
|
||||
const isAppRunning = computed(() => globalStore.isAppRunning)
|
||||
const viewiOS = ref(false);
|
||||
const viewAndroid = ref(false);
|
||||
const showNotice = ref(false);
|
||||
const showOther = ref(false);
|
||||
|
||||
const finishLoading = computed(() => globalStore.finishLoading)
|
||||
// === Rilevamento WebView ===
|
||||
const currentUrl = window.location.href;
|
||||
|
||||
const deferredPrompt = computed(() => globalStore.deferredPrompt)
|
||||
const homescreen = computed(() => globalStore.homescreen)
|
||||
const webViewDetectors = [
|
||||
{ name: 'Telegram', test: /Telegram/ },
|
||||
{ name: 'WhatsApp', test: /WhatsApp/ },
|
||||
{ name: 'Facebook', test: /FBAV|FBAN/ },
|
||||
{ name: 'Instagram', test: /Instagram/ },
|
||||
{ name: 'Messenger', test: /Messenger/ },
|
||||
];
|
||||
|
||||
const matchedWebView = webViewDetectors.find(({ test }) => test.test(navigator.userAgent));
|
||||
const isInRestrictedWebView = !!matchedWebView;
|
||||
const webViewName = matchedWebView ? matchedWebView.name : 'un’app';
|
||||
|
||||
const viewiOS = ref(false)
|
||||
const viewAndroid = ref(false)
|
||||
|
||||
// === Installazione ===
|
||||
function installApp() {
|
||||
if (globalStore.deferredPrompt) {
|
||||
globalStore.deferredPrompt.prompt()
|
||||
|
||||
// Wait for the user to respond to the prompt
|
||||
globalStore.deferredPrompt.prompt();
|
||||
globalStore.deferredPrompt.userChoice.then((choiceResult: any) => {
|
||||
if (choiceResult.outcome === 'accepted') {
|
||||
globalStore.deferredPrompt = null;
|
||||
// console.log('User accepted the A2HS prompt');
|
||||
} else {
|
||||
// console.log('User dismissed the A2HS prompt');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
tools.checkApp()
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
onMounted(() => {
|
||||
tools.checkApp();
|
||||
});
|
||||
|
||||
return {
|
||||
userStore,
|
||||
tools,
|
||||
costanti,
|
||||
finishLoading,
|
||||
installApp,
|
||||
isAppRunning,
|
||||
deferredPrompt,
|
||||
homescreen,
|
||||
viewiOS,
|
||||
viewAndroid,
|
||||
homescreen,
|
||||
}
|
||||
}
|
||||
})
|
||||
installApp,
|
||||
isInRestrictedWebView,
|
||||
webViewName,
|
||||
currentUrl,
|
||||
showNotice,
|
||||
showOther,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user