From 338bcd0df9885c6047286f5b18af273a32eefbcf Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Fri, 28 Mar 2025 15:02:59 +0100 Subject: [PATCH] Conditional Rendering --- layouts/mobile.vue | 2 +- pages/standardEntity/[type]/[[mode]]/[[id]].vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/mobile.vue b/layouts/mobile.vue index 4897bc6..7257b11 100644 --- a/layouts/mobile.vue +++ b/layouts/mobile.vue @@ -142,7 +142,7 @@ const footerLinks = [/*{ - + diff --git a/pages/standardEntity/[type]/[[mode]]/[[id]].vue b/pages/standardEntity/[type]/[[mode]]/[[id]].vue index 025a24c..fe068d9 100644 --- a/pages/standardEntity/[type]/[[mode]]/[[id]].vue +++ b/pages/standardEntity/[type]/[[mode]]/[[id]].vue @@ -11,8 +11,8 @@ const dataStore = useDataStore() const supabase = useSupabaseClient() const type = route.params.type -const platform = useCapacitor().getIsPhone() ? "mobile" : "default" - +const platform = await useCapacitor().getIsPhone() ? "mobile" : "default" +console.log(platform) const dataType = dataStore.dataTypes[route.params.type] @@ -24,7 +24,7 @@ const item = ref({}) const setupPage = async () => { - if(platform === "mobile") { + if(await useCapacitor().getIsPhone()) { setPageLayout("mobile") }