@graphcommerce/framer-next-pages 8.1.0-canary.19 → 8.1.0-canary.20

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
@@ -1,5 +1,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.1.0-canary.20
4
+
3
5
  ## 8.1.0-canary.19
4
6
 
5
7
  ## 8.1.0-canary.18
@@ -10,24 +10,17 @@ export function useHistoryLink(options: UseHistoryLink) {
10
10
  const prevRouter = usePrevPageRouter()
11
11
  const router = useRouter()
12
12
 
13
- const onClick =
14
- href === prevRouter?.asPath
15
- ? (e: ClickEvent) => {
16
- e.preventDefault()
17
- router.back()
18
- }
19
- : undefined
13
+ const onClick = (e: ClickEvent) => {
14
+ e.preventDefault()
15
+
16
+ if (href === prevRouter?.asPath) return router.back()
17
+ return router.replace(href)
18
+ }
20
19
 
21
20
  return { onClick, href }
22
21
  }
23
22
 
24
23
  export function useHistoryGo(options: UseHistoryLink) {
25
- const { onClick, href } = useHistoryLink(options)
26
- const router = useRouter()
27
-
28
- return () => {
29
- if (onClick) onClick({ preventDefault: () => {} })
30
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
31
- else router.push(href)
32
- }
24
+ const { onClick } = useHistoryLink(options)
25
+ return () => onClick({ preventDefault: () => {} })
33
26
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/framer-next-pages",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.19",
5
+ "version": "8.1.0-canary.20",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,10 +12,10 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.19",
16
- "@graphcommerce/framer-utils": "^8.1.0-canary.19",
17
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.19",
18
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.19",
15
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.20",
16
+ "@graphcommerce/framer-utils": "^8.1.0-canary.20",
17
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.20",
18
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.20",
19
19
  "framer-motion": "^10.0.0",
20
20
  "next": "*",
21
21
  "react": "^18.2.0",