@globalbrain/sefirot 3.51.0 → 3.51.1

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,5 +1,5 @@
1
1
  import isEqual from 'lodash-es/isEqual'
2
- import { type MaybeRef, nextTick, unref, watch } from 'vue'
2
+ import { type MaybeRef, computed, nextTick, unref, watch } from 'vue'
3
3
  import { type LocationQuery, useRoute, useRouter } from 'vue-router'
4
4
 
5
5
  export interface UseUrlQuerySyncOptions {
@@ -21,13 +21,22 @@ export function useUrlQuerySync(
21
21
  const route = useRoute()
22
22
  const router = useRouter()
23
23
 
24
+ const routeQuery = computed(() => ({
25
+ path: route.path,
26
+ query: route.query
27
+ }))
28
+
24
29
  const flattenedDefaultState = flattenObject(unref(state))
25
30
 
26
31
  let isSyncing = false
27
32
 
28
33
  watch(
29
- () => route.query,
30
- async () => {
34
+ routeQuery,
35
+ async (to, from) => {
36
+ if (from && from.path !== to.path) {
37
+ return
38
+ }
39
+
31
40
  if (!isSyncing) {
32
41
  isSyncing = true
33
42
  await setState()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "3.51.0",
3
+ "version": "3.51.1",
4
4
  "packageManager": "pnpm@9.1.1",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",