@inzombieland/core 1.19.6 → 1.19.8

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.
@@ -1,8 +1,9 @@
1
- import { onMounted, ref } from "vue";
1
+ import { ref } from "vue";
2
2
  import { useBus, useUserActions } from "../index.mjs";
3
3
  const activeSessions = ref([]);
4
4
  export function useActiveSessions() {
5
5
  const userActions = useUserActions();
6
+ const bus = useBus();
6
7
  const fetchActiveSessions = async () => {
7
8
  if (activeSessions.value.length === 0) {
8
9
  const data = await userActions?.value.fetchActiveSessions();
@@ -10,15 +11,11 @@ export function useActiveSessions() {
10
11
  }
11
12
  };
12
13
  fetchActiveSessions();
13
- onMounted(() => {
14
- const bus = useBus();
15
- const subscription = bus.subscribe("user:onUpdated", (user) => {
16
- console.log("IO user updated", user);
17
- if (!user) {
18
- activeSessions.value = [];
19
- subscription.unsubscribe();
20
- }
21
- });
14
+ const subscription = bus.subscribe("user:onUpdated", (user) => {
15
+ if (!user) {
16
+ activeSessions.value = [];
17
+ subscription.unsubscribe();
18
+ }
22
19
  });
23
20
  return activeSessions;
24
21
  }
@@ -15,7 +15,7 @@ function initApplication() {
15
15
  const i18n = useI18n();
16
16
  const userActions = useUserActions();
17
17
  watch(user, (user2) => {
18
- if (user2 && user2.theme !== theme.value?.value) {
18
+ if (user2 && user2.theme && user2.theme !== theme.value?.value) {
19
19
  theme.value = { value: user2.theme };
20
20
  }
21
21
  if (user2 && user2.locale !== locale.value?.value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.19.6",
3
+ "version": "1.19.8",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",