This repository was archived by the owner on Jan 31, 2023. It is now read-only.
File tree 4 files changed +24
-13
lines changed 4 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 22
22
"framer-motion" : " 4.1.17" ,
23
23
"lenses-ppx" : " 6.1.10" ,
24
24
"localforage" : " 1.10.0" ,
25
+ "mitt" : " 3.0.0" ,
25
26
"postcss" : " 8.3.5" ,
26
27
"qs" : " 6.10.1" ,
27
28
"react" : " 17.0.2" ,
28
29
"react-content-loader" : " 6.0.3" ,
29
30
"react-dom" : " 17.0.2" ,
30
31
"react-paginate" : " 8.0.0" ,
31
32
"react-query" : " 3.19.2" ,
32
- "react-use" : " 17.2.4 " ,
33
+ "react-use" : " 17.3.1 " ,
33
34
"reschema" : " 2.0.3" ,
34
35
"rescript" : " 9.1.3" ,
35
36
"rescript-polished" : " ^1.15.0" ,
Original file line number Diff line number Diff line change @@ -20,11 +20,13 @@ module Main = {
20
20
let make = () => {
21
21
let route = Router .useRouter ()
22
22
23
- <ReactQuery .Provider client = {queryClient }>
24
- {switch route {
25
- | Signin => <Signin />
26
- | Signup => <Signup />
27
- | _ => <Main />
28
- }}
29
- </ReactQuery .Provider >
23
+ <UseAuthHook .Provider >
24
+ <ReactQuery .Provider client = {queryClient }>
25
+ {switch route {
26
+ | Signin => <Signin />
27
+ | Signup => <Signup />
28
+ | _ => <Main />
29
+ }}
30
+ </ReactQuery .Provider >
31
+ </UseAuthHook .Provider >
30
32
}
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ let apiUrl = "https://conduit-api-fp.herokuapp.com/api"
4
4
5
5
let validateRequestError = response => {
6
6
switch response -> Fetch .Response .status {
7
- | 401 => LocalForage .clear ()-> ignore
7
+ | 401 => {
8
+ UseAuthHook .emitter -> Mitt .emit (UseAuthHook .unauthorizedEvent )
9
+ LocalForage .clear ()-> ignore
10
+ }
8
11
| _ => ()
9
12
}
10
13
switch response -> Fetch .Response .ok {
Original file line number Diff line number Diff line change @@ -7553,6 +7553,11 @@ mississippi@^3.0.0:
7553
7553
stream-each "^1.1.0"
7554
7554
through2 "^2.0.0"
7555
7555
7556
+
7557
+ version "3.0.0"
7558
+ resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.0.tgz#69ef9bd5c80ff6f57473e8d89326d01c414be0bd"
7559
+ integrity sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==
7560
+
7556
7561
mixin-deep@^1.2.0 :
7557
7562
version "1.3.2"
7558
7563
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
@@ -8884,10 +8889,10 @@ react-universal-interface@^0.6.2:
8884
8889
resolved "https://registry.yarnpkg.com/react-universal-interface/-/react-universal-interface-0.6.2.tgz#5e8d438a01729a4dbbcbeeceb0b86be146fe2b3b"
8885
8890
integrity sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw==
8886
8891
8887
- react-use@17.2.4 :
8888
- version "17.2.4 "
8889
- resolved "https://registry.yarnpkg.com/react-use/-/react-use-17.2.4 .tgz#1f89be3db0a8237c79253db0a15e12bbe3cfeff1 "
8890
- integrity sha512-vQGpsAM0F5UIlshw5UI8ULGPS4yn5rm7/qvn3T1Gnkrz7YRMEEMh+ynKcmRloOyiIeLvKWiQjMiwRGtdbgs5qQ ==
8892
+ react-use@17.3.1 :
8893
+ version "17.3.1 "
8894
+ resolved "https://registry.yarnpkg.com/react-use/-/react-use-17.3.1 .tgz#12b248555775519aa2b900b22f1928d029bf99d1 "
8895
+ integrity sha512-hs7+tS4rRm1QLHPfanLCqXIi632tP4V7Sai1ENUP2WTufU6am++tU9uSw9YrNCFqbABiEv0ndKU1XCUcfu2tXA ==
8891
8896
dependencies :
8892
8897
" @types/js-cookie" " ^2.2.6"
8893
8898
" @xobotyi/scrollbar-width" " ^1.9.5"
You can’t perform that action at this time.
0 commit comments