- check updates

- risolto problema della generazione dei PDF, avevo modificato in CMyPageElem , se si cambia qualcosa occorre stare attenti a mettere !hideHeader
This commit is contained in:
Surya Paolo
2025-11-01 12:00:49 +01:00
parent df98ec9471
commit d179581b23
78 changed files with 3593139 additions and 304 deletions

View File

@@ -1,5 +1,14 @@
import type { PropType } from 'vue';
import { computed, defineComponent, onMounted, ref, toRef, watch, nextTick } from 'vue';
import {
computed,
defineComponent,
onMounted,
ref,
toRef,
watch,
nextTick,
onUnmounted,
} from 'vue';
import type { IOptCatalogo, ICoordGPS, IMyElem, ISocial } from '@src/model';
import { IMyCard, IMyPage, IOperators } from '@src/model';
@@ -195,6 +204,8 @@ export default defineComponent({
const newtype = ref(<any>'');
const canShowVersion = ref(false);
const isAppRunning = computed(() => globalStore.isAppRunning);
const cardGroupMaxWidth = computed(() => {
@@ -307,6 +318,10 @@ export default defineComponent({
myel.value = props.myelem;
neworder.value = props.myelem.order;
setTimeout(() => {
canShowVersion.value = true;
}, 60000);
if (props.myelem) newtype.value = props.myelem.type;
nextTick(() => {
@@ -394,8 +409,23 @@ export default defineComponent({
}
}
const updateApp = async () => {
// Invia il messaggio al Service Worker per saltare l'attesa
const registration = await navigator.serviceWorker.getRegistration();
if (registration?.waiting) {
registration.waiting.postMessage({ type: 'SKIP_WAITING' });
}
// Ricarica la pagina
window.location.reload();
};
onMounted(mounted);
const isNewVersionAvailable = computed(() => {
return canShowVersion.value ? globalStore.isNewVersionAvailable : false;
});
return {
tools,
shared_consts,
@@ -444,6 +474,7 @@ export default defineComponent({
cardGroupMaxWidth,
cardScroller,
scrollCards,
isNewVersionAvailable,
};
},
});