Add web app install button and step-by-step PWA guide.
This commit is contained in:
@@ -18,6 +18,7 @@ import { setTruth } from '@/app/authBoot'
|
||||
import { completeLoginNavigation } from '@/layouts/composables/useMobileScrollReset'
|
||||
import { normalizeAuthFormFields } from '@/utils/persianDigits'
|
||||
import { beginSmsOtpCapture, clearPendingSmsOtp } from '@/utils/webOtp'
|
||||
import { usePwaInstall } from '@/composables/usePwaInstall'
|
||||
|
||||
export function useLoginForm() {
|
||||
const { time, onFinish, reset } = useCountdownTimer('00:02:00', 'mm:ss')
|
||||
@@ -29,7 +30,7 @@ export function useLoginForm() {
|
||||
const refOtpInput = ref<InstanceType<typeof SmsOtpField> | null>(null)
|
||||
const isSMS = ref(true)
|
||||
const isRegister = ref<boolean | undefined>()
|
||||
const showPWAInstallGuide = ref(false)
|
||||
const { tryInstallOrOpenGuide, completeGuide } = usePwaInstall()
|
||||
|
||||
const userFormState = reactive<Login>({
|
||||
provider: 'customer',
|
||||
@@ -137,11 +138,11 @@ export function useLoginForm() {
|
||||
}
|
||||
|
||||
function installWebApp() {
|
||||
showPWAInstallGuide.value = true
|
||||
void tryInstallOrOpenGuide()
|
||||
}
|
||||
|
||||
function proceedWithInstall() {
|
||||
showPWAInstallGuide.value = false
|
||||
void completeGuide()
|
||||
}
|
||||
|
||||
const submitLabel = computed(() => {
|
||||
@@ -165,7 +166,6 @@ export function useLoginForm() {
|
||||
refOtpInput,
|
||||
isSMS,
|
||||
isRegister,
|
||||
showPWAInstallGuide,
|
||||
userFormState,
|
||||
loading,
|
||||
submitLabel,
|
||||
|
||||
Reference in New Issue
Block a user