Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit f1fc738

Browse files
committed
fix(ci): protect from crash when init load
1 parent 9575708 commit f1fc738

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ before_script:
2727
script:
2828
# - codecov
2929
- rm -rf .next
30-
- nvm exec 12.4.0 npm run build.ci
31-
- nvm exec 12.4.0 npm run test:ci
30+
- nvm exec 10.12.0 npm run build.ci
31+
- nvm exec 10.12.0 npm run test:ci
3232

3333
cache:
3434
directories:

containers/JobsThread/logic.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ const sr71$ = new SR71({
2424
let store = null
2525
let sub$ = null
2626

27-
export const inAnchor = () => store.setHeaderFix(false)
28-
export const outAnchor = () => store.setHeaderFix(true)
27+
export const inAnchor = () => {
28+
if (store) store.setHeaderFix(false)
29+
}
30+
31+
export const outAnchor = () => {
32+
if (store) store.setHeaderFix(true)
33+
}
2934

3035
export const loadJobs = (page = 1) => {
3136
const { curCommunity } = store

containers/PostsThread/logic.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ const sr71$ = new SR71({
3838
let store = null
3939
let sub$ = null
4040

41-
export const inAnchor = () => store.setHeaderFix(false)
42-
export const outAnchor = () => store.setHeaderFix(true)
41+
export const inAnchor = () => {
42+
if (store) store.setHeaderFix(false)
43+
}
44+
45+
export const outAnchor = () => {
46+
if (store) store.setHeaderFix(true)
47+
}
4348

4449
export const loadPosts = (page = 1) => {
4550
const { curCommunity } = store
@@ -247,7 +252,6 @@ export const useInit = _store =>
247252
store = _store
248253
// log('effect init')
249254
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
250-
251255
/*
252256
NOTE: city communities list is not supported by SSR
253257
need load manully

containers/ReposThread/logic.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ const sr71$ = new SR71({
2323
let sub$ = null
2424
let store = null
2525

26-
export const inAnchor = () => store.setHeaderFix(false)
27-
export const outAnchor = () => store.setHeaderFix(true)
26+
export const inAnchor = () => {
27+
if (store) store.setHeaderFix(false)
28+
}
29+
30+
export const outAnchor = () => {
31+
if (store) store.setHeaderFix(true)
32+
}
2833

2934
export const loadRepos = (page = 1) => {
3035
const { curCommunity } = store

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"baseUrl": "http://localhost:3000",
33
"projectId": "w5dkjg",
4-
"pageLoadTimeout": 1000000
4+
"pageLoadTimeout": 6000000
55
}

travis/install_node.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh |
55
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
66
echo "> check nvm"
77
nvm --version
8-
echo "> use node 12.4.0"
9-
nvm install 12.4.0
10-
nvm alias default 12.4.0
8+
echo "> use node 10.12.0"
9+
nvm install 10.12.0
10+
nvm alias default 10.12.0
1111
echo "> install node done"
1212
node --version
1313
pwd

0 commit comments

Comments
 (0)