File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
handlereg.web.frontend/src/main/frontend/src Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,5 @@ export const VELG_FAVORITTBUTIKK = createAction('VELG_FAVORITTBUTIKK');
14
14
export const VIS_KVITTERING = createAction ( 'VIS_KVITTERING' ) ;
15
15
16
16
export const SET_BASENAME = createAction ( 'SET_BASENAME' ) ;
17
+
18
+ export const LOCATION_CHANGE = createAction ( 'LOCATION_CHANGE' ) ;
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import { Link } from 'react-router' ;
1
+ import React , { useEffect } from 'react' ;
2
+ import { Link , useLocation } from 'react-router' ;
3
3
import { useSelector , useDispatch } from 'react-redux' ;
4
4
import { useSwipeable } from 'react-swipeable' ;
5
5
import {
@@ -12,6 +12,7 @@ import {
12
12
BELOP_ENDRE ,
13
13
HOME_BUTIKKNAVN_ENDRE ,
14
14
DATO_ENDRE ,
15
+ LOCATION_CHANGE ,
15
16
} from '../actiontypes' ;
16
17
import Kvittering from './Kvittering' ;
17
18
import ChevronRight from './bootstrap/ChevronRight' ;
@@ -29,6 +30,8 @@ export default function Home() {
29
30
const handledato = handletidspunkt . split ( 'T' ) [ 0 ] ;
30
31
const belop = useSelector ( state => state . belop ) . toString ( ) ;
31
32
const dispatch = useDispatch ( ) ;
33
+ const location = useLocation ( ) ;
34
+ useEffect ( ( ) => { dispatch ( LOCATION_CHANGE ( location ) ) } , [ location ] ) ;
32
35
const onNextPageClicked = async ( ) => fetchNextPage ( ) ;
33
36
const onRegistrerHandlingClicked = async ( ) => {
34
37
await postNyhandling ( { storeId, belop, handletidspunkt, username } )
You can’t perform that action at this time.
0 commit comments