Skip to content

Commit 9517217

Browse files
committed
=resolve merge conflict
1 parent 57e2caf commit 9517217

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/utils/lifeCycle.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ import * as utils from "../utils";
55
export default function appInit() {
66
let initialQuery;
77
let urlPath;
8+
let firstMounted = true;
89

910
function bootstrap() {
1011
return Promise.resolve().then(() => {
1112
initialQuery = window.location.search;
12-
urlPath = window.location.pathname;
13+
urlPath = utils.url.removeTrailingSlash(window.location.pathname);
1314
});
1415
}
1516

1617
async function mount() {
1718
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;
2226
}
2327
} catch (error) {
2428
console.error(error)

0 commit comments

Comments
 (0)