fix(pwa): added PWAInstallTutorial to handle pwa install instructions
This commit is contained in:
@@ -332,6 +332,13 @@
|
||||
</router-link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- PWA Install Tutorial -->
|
||||
<PWAInstallTutorial
|
||||
:show="showPWAInstructions"
|
||||
:is-ios="isIOS"
|
||||
@close="showPWAInstructions = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -342,6 +349,7 @@ import { useAuthStore } from '@/stores/auth'
|
||||
import StepTransition from '@/components/StepTransition.vue'
|
||||
import PasswordStrength from '@/components/PasswordStrength.vue'
|
||||
import FormValidation from '@/components/FormValidation.vue'
|
||||
import PWAInstallTutorial from '@/components/PWAInstallTutorial.vue'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const router = useRouter()
|
||||
@@ -440,6 +448,9 @@ async function handleRegister() {
|
||||
|
||||
// PWA Installation
|
||||
const isMobile = ref(false)
|
||||
const showPWAInstructions = ref(false)
|
||||
|
||||
const isIOS = computed(() => /iPhone|iPad|iPod/i.test(navigator.userAgent))
|
||||
|
||||
function checkIfMobile() {
|
||||
isMobile.value = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) ||
|
||||
@@ -466,9 +477,8 @@ async function handleInstallApp() {
|
||||
console.error('Erreur lors de l\'installation:', error)
|
||||
}
|
||||
} else if (isMobile.value) {
|
||||
// Sur mobile sans beforeinstallprompt, on ne peut pas installer directement
|
||||
// L'utilisateur devra utiliser le menu une fois connecté
|
||||
console.log('Installation PWA non disponible sur ce navigateur mobile')
|
||||
// Sur mobile sans beforeinstallprompt, afficher les instructions
|
||||
showPWAInstructions.value = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user