@icvdeveloper/common-module 1.1.5 → 1.1.7
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/CHANGELOG.md
CHANGED
package/dist/module.json
CHANGED
|
@@ -148,12 +148,12 @@ const eventPathPrefix = computed(() => {
|
|
|
148
148
|
const eventType = computed((): Conference[] => {
|
|
149
149
|
if (isUpcoming?.value) {
|
|
150
150
|
if (isReversed?.value) {
|
|
151
|
-
return reverse(upcomingEvents.value);
|
|
151
|
+
return reverse(upcomingEvents.value.slice());
|
|
152
152
|
} else {
|
|
153
153
|
return upcomingEvents.value;
|
|
154
154
|
}
|
|
155
155
|
} else if (isReversed?.value) {
|
|
156
|
-
return reverse(pastEvents.value);
|
|
156
|
+
return reverse(pastEvents.value.slice());
|
|
157
157
|
} else {
|
|
158
158
|
return pastEvents.value;
|
|
159
159
|
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { defineStore } from "pinia";
|
|
2
2
|
import { merge } from "lodash-es";
|
|
3
|
+
import { DateTime } from "luxon";
|
|
3
4
|
import { useApi } from "../composables/useApi.mjs";
|
|
4
5
|
import { useConferencesStore } from "./conferences.mjs";
|
|
5
6
|
export const useAuthStore = defineStore("auth", {
|
|
7
|
+
persist: {
|
|
8
|
+
afterRestore(context) {
|
|
9
|
+
if (context.store.$state.user) {
|
|
10
|
+
const user = context.store.$state.user;
|
|
11
|
+
const now = DateTime.now().setZone("utc");
|
|
12
|
+
const expiration = DateTime.fromFormat(
|
|
13
|
+
user.expires_at,
|
|
14
|
+
"yyyy-MM-dd HH:mm:ss",
|
|
15
|
+
{ zone: "utc" }
|
|
16
|
+
).minus({ hours: 2 });
|
|
17
|
+
if (now >= expiration) {
|
|
18
|
+
context.store.reset();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
6
23
|
state: () => ({
|
|
7
24
|
user: null
|
|
8
25
|
}),
|