@inzombieland/core 1.18.56 → 1.19.0
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,7 +1,8 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { useUserActions } from "../index.mjs";
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
import { useUser, useUserActions } from "../index.mjs";
|
|
3
3
|
const activeSessions = ref([]);
|
|
4
4
|
export function useActiveSessions() {
|
|
5
|
+
const user = useUser();
|
|
5
6
|
const userActions = useUserActions();
|
|
6
7
|
const fetchActiveSessions = async () => {
|
|
7
8
|
if (activeSessions.value.length === 0) {
|
|
@@ -10,5 +11,10 @@ export function useActiveSessions() {
|
|
|
10
11
|
}
|
|
11
12
|
};
|
|
12
13
|
fetchActiveSessions();
|
|
14
|
+
watch(user, (user2) => {
|
|
15
|
+
if (!user2) {
|
|
16
|
+
activeSessions.value = [];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
13
19
|
return activeSessions;
|
|
14
20
|
}
|
package/helpers/api-helper.mjs
CHANGED
|
@@ -97,19 +97,9 @@ function parseData(data) {
|
|
|
97
97
|
}
|
|
98
98
|
function stringToDate(dateString) {
|
|
99
99
|
if (typeof dateString !== "string" || dateString === "0001-01-01T00:00:00Z") {
|
|
100
|
-
return
|
|
100
|
+
return;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
if (!parts) {
|
|
104
|
-
return new Date(Number.NaN);
|
|
105
|
-
}
|
|
106
|
-
const year = Number(parts[1]);
|
|
107
|
-
const month = Number(parts[2]) - 1;
|
|
108
|
-
const day = Number(parts[3]);
|
|
109
|
-
const hours = Number(parts[4]);
|
|
110
|
-
const minutes = Number(parts[5]);
|
|
111
|
-
const seconds = Number(parts[6]);
|
|
112
|
-
return parts.at(-1) === "Z" ? new Date(Date.UTC(year, month, day, hours, minutes, seconds)) : new Date(year, month, day, hours, minutes, seconds);
|
|
102
|
+
return new Date(dateString);
|
|
113
103
|
}
|
|
114
104
|
function dateToString(date) {
|
|
115
105
|
const year = date.getFullYear();
|