Просмотр исходного кода

fix: :bug: fix(notificação chamativa) Foi ajustado olayout do status bar para que respeite o temo do celular

Foi ajustado o layout do status bar para que respeite o tema do celular ex:layout branco status bar branca com iicones pretos

origin:bug-interno
kayo henrique 2 дней назад
Родитель
Сommit
7f2d7ec25e
1 измененных файлов с 18 добавлено и 3 удалено
  1. 18 3
      src/App.vue

+ 18 - 3
src/App.vue

@@ -17,6 +17,7 @@ defineOptions({
 const { locale } = useI18n();
 
 const $q = useQuasar();
+
 const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches
   ? "dark"
   : "light";
@@ -37,13 +38,27 @@ watch(
 
 onBeforeMount(async () => {
   const isNative = Capacitor.isNativePlatform();
-  if (isNative) await StatusBar.show();
+
   const { value: themePref } = await Preferences.get({ key: "theme" });
   const theme = themePref || systemTheme;
-  if (isNative) await StatusBar.setStyle({ style: Style.Dark });
+
+  if (isNative) {
+  await StatusBar.show();
+
+  await StatusBar.setBackgroundColor({
+    color: "#FFFFFF",
+  });
+
+  await StatusBar.setStyle({
+    style: Style.Dark,
+  });
+}
+
   const { value: localePref } = await Preferences.get({ key: "locale" });
   const userLocale = localePref || window.navigator.language;
+
   console.log(theme, userLocale);
-  $q.dark.set(theme == "dark");
+
+  $q.dark.set(theme === "dark");
 });
 </script>