fixes
Some checks failed
Build And Push Image / docker (push) Has been cancelled

This commit is contained in:
2025-08-10 15:21:43 +02:00
parent 30136117ce
commit 9572291299
3 changed files with 29 additions and 37 deletions

View File

@@ -215,6 +215,7 @@
<script setup lang="ts">
import { getAllCountries, searchCountries } from '~/utils/countries';
import { getStaticDeviceInfo } from '~/utils/static-device-detection';
interface Props {
modelValue?: string; // Comma-separated string like "FR,MC,US"
@@ -241,9 +242,10 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<Emits>();
// Static mobile detection (no reactive dependencies)
const isMobile = ref(false);
const isMobileSafari = ref(false);
const needsPerformanceMode = ref(false);
const deviceInfo = getStaticDeviceInfo();
const isMobile = ref(deviceInfo.isMobile);
const isMobileSafari = ref(deviceInfo.isMobileSafari);
const needsPerformanceMode = ref(deviceInfo.isMobileSafari || deviceInfo.isMobile);
// Parse initial nationalities from comma-separated string
const parseNationalities = (value: string): string[] => {
@@ -374,14 +376,6 @@ watch(nationalities, () => {
// Initialize the model value on mount if needed
onMounted(() => {
// Apply static device detection - no reactive dependencies
const { isMobile: deviceIsMobile, isIos, isSafari } = useDevice();
// Set static values once
isMobile.value = deviceIsMobile || false;
isMobileSafari.value = (deviceIsMobile && isIos && isSafari) || false;
needsPerformanceMode.value = isMobileSafari.value || isMobile.value;
if (!props.modelValue && validNationalities.value.length > 0) {
updateNationalities();
}

View File

@@ -155,6 +155,7 @@
<script setup lang="ts">
import { parsePhoneNumber, AsYouType } from 'libphonenumber-js';
import { getPhoneCountriesWithPreferred, searchPhoneCountries, getPhoneCountryByCode, type PhoneCountry } from '~/utils/phone-countries';
import { getStaticDeviceInfo } from '~/utils/static-device-detection';
interface Props {
modelValue?: string;
@@ -188,8 +189,9 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<Emits>();
// Static mobile detection (no reactive dependencies)
const isMobile = ref(false);
const isMobileSafari = ref(false);
const deviceInfo = getStaticDeviceInfo();
const isMobile = ref(deviceInfo.isMobile);
const isMobileSafari = ref(deviceInfo.isMobileSafari);
// Create computed-like object for template compatibility
const mobileDetection = computed(() => ({
@@ -324,14 +326,13 @@ watch(dropdownOpen, (isOpen) => {
}
});
// Apply static device detection on mount
// Component initialization - values already set from static detection
onMounted(() => {
// Static device detection from Nuxt Device Module - no reactive dependencies
const { isMobile: deviceIsMobile, isIos, isSafari } = useDevice();
// Apply device state once (static, no reactivity)
isMobile.value = deviceIsMobile || false;
isMobileSafari.value = (deviceIsMobile && isIos && isSafari) || false;
// Device detection already applied statically - no additional setup needed
console.log('[PhoneInputWrapper] Initialized with device info:', {
isMobile: deviceInfo.isMobile,
isMobileSafari: deviceInfo.isMobileSafari
});
});
</script>