@inzombieland/nuxt-common 1.18.8 → 1.18.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.18.8",
3
+ "version": "1.18.10",
4
4
  "configKey": "nuxt-common",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.6.0",
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
2
2
  import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
3
3
 
4
4
  const name = "@inzombieland/nuxt-common";
5
- const version = "1.18.8";
5
+ const version = "1.18.10";
6
6
 
7
7
  const module = defineNuxtModule({
8
8
  meta: {
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { onBeforeMount, onMounted, ref } from "vue"
2
+ import { onMounted, ref } from "vue"
3
3
  import bus from "./bus"
4
4
  import { useThemeMode, useUser } from "./index"
5
5
  import type { ConfigProviderTheme } from "vant"
@@ -9,12 +9,9 @@ const theme = useThemeMode()
9
9
  const user = useUser()
10
10
  const appLoading = ref(Boolean(user.value))
11
11
 
12
- onBeforeMount(() => {
13
- bus.publish("app:beforeMount", true)
14
- })
15
-
16
12
  onMounted(() => {
17
13
  appLoading.value = false
14
+ bus.publish("app:mounted", true)
18
15
  })
19
16
  </script>
20
17
 
@@ -44,7 +44,7 @@ export function initApiFetch($fetch, config) {
44
44
  }
45
45
  loggedIn.value = user ? "yes" : "no";
46
46
  });
47
- bus.subscribe("app:beforeMount", () => {
47
+ bus.subscribe("app:mounted", () => {
48
48
  getVisitorIdentifier();
49
49
  initApplication();
50
50
  });
@@ -23,6 +23,16 @@ function initApplication() {
23
23
  locale.value = { value: user2.locale };
24
24
  }
25
25
  });
26
+ watch(theme, (theme2) => {
27
+ if (user.value && user.value?.theme !== theme2?.value) {
28
+ userActions?.value.changeTheme({ theme: theme2?.value });
29
+ }
30
+ });
31
+ watch(locale, (locale2) => {
32
+ if (user.value && user.value?.locale !== locale2?.value) {
33
+ userActions?.value.changeLocale({ locale: locale2?.value });
34
+ }
35
+ });
26
36
  watch(
27
37
  theme,
28
38
  (theme2) => {
@@ -35,7 +45,6 @@ function initApplication() {
35
45
  document.documentElement.classList.add("light", "van-theme-light");
36
46
  StyleProvider(null);
37
47
  }
38
- userActions?.value.changeTheme({ theme: theme2?.value });
39
48
  },
40
49
  { immediate: true }
41
50
  );
@@ -53,7 +62,6 @@ function initApplication() {
53
62
  VantLocale.use(locale2, ruRU);
54
63
  VarletLocale.add("en-US", VarletLocale.enUS);
55
64
  }
56
- userActions?.value.changeLocale({ locale: locale2?.value });
57
65
  },
58
66
  { immediate: true }
59
67
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.18.8",
3
+ "version": "1.18.10",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.18.8",
3
+ "version": "1.18.10",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "exports": {