File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,24 @@ import * as utils from "../utils";
5
5
export default function appInit ( ) {
6
6
let initialQuery ;
7
7
let urlPath ;
8
+ let firstMounted = true ;
8
9
9
10
function bootstrap ( ) {
10
11
return Promise . resolve ( ) . then ( ( ) => {
11
12
initialQuery = window . location . search ;
12
- urlPath = window . location . pathname ;
13
+ urlPath = utils . url . removeTrailingSlash ( window . location . pathname ) ;
13
14
} ) ;
14
15
}
15
16
16
17
async function mount ( ) {
17
18
try {
18
- if ( initialQuery ) {
19
- const params = utils . url . parseUrlQuery ( initialQuery ) ;
20
- const filter = utils . challenge . createChallengeFilter ( params ) ;
21
- store . dispatch ( action . initApp ( filter ) ) ;
19
+ if ( firstMounted ) {
20
+ if ( initialQuery && urlPath === '/earn/find/challenges' ) {
21
+ const params = utils . url . parseUrlQuery ( initialQuery ) ;
22
+ const filter = utils . challenge . createChallengeFilter ( params ) ;
23
+ store . dispatch ( action . initApp ( filter ) ) ;
24
+ }
25
+ firstMounted = false ;
22
26
}
23
27
} catch ( error ) {
24
28
console . error ( error )
You can’t perform that action at this time.
0 commit comments