Skip to content

Commit 1af8736

Browse files
committed
Merge branch 'release/0.2.3'
2 parents 90aafab + d4b14dc commit 1af8736

11 files changed

+42
-21
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [0.2.3] - 2018-04-12
10+
11+
### Changed
12+
- Fixed data not loading in the first 5 seconds.
13+
914
## [0.2.2] - 2018-02-04
1015

1116
### Changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ npm install -g nelson.gui
2323
And run it
2424

2525
```
26-
nelson.gui --p 5000
26+
nelson.gui -p 5000
2727
```
2828

2929
### Running as a service
@@ -38,7 +38,7 @@ npm install pm2 -g
3838
pm2 startup
3939
4040
# Start the Nelson GUI as service
41-
pm2 start nelson.gui -- --port 3333
41+
pm2 start nelson.gui --port 3333
4242
4343
# Save current processes runing with pm2 to startup on boot:
4444
pm2 save
@@ -72,7 +72,7 @@ Is your Nelson's API running on a non-standard host:port (localhost:18600)?
7272
Simply provide it when starting the GUI:
7373

7474
```
75-
nelson.gui --p 5000 --apiHostname another.hostname.com --apiPort 123456
75+
nelson.gui -p 5000 --apiHostname another.hostname.com --apiPort 123456
7676
```
7777

7878
The data is refreshed automatically each 5 seconds (or at the heartbeat rate of your Nelson)

build/asset-manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"main.css": "static/css/main.ef153f8d.css",
33
"main.css.map": "static/css/main.ef153f8d.css.map",
4-
"main.js": "static/js/main.c68bff14.js",
5-
"main.js.map": "static/js/main.c68bff14.js.map"
4+
"main.js": "static/js/main.94d568ad.js",
5+
"main.js.map": "static/js/main.94d568ad.js.map"
66
}

build/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"><title>Nelson Monitor</title><link href="/static/css/main.ef153f8d.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.c68bff14.js"></script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"><title>Nelson Monitor</title><link href="/static/css/main.ef153f8d.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.94d568ad.js"></script></body></html>

build/service-worker.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.c68bff14.js build/static/js/main.94d568ad.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.94d568ad.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.c68bff14.js.map

-1
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nelson.gui",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/SemkoDev/nelson.gui.git"

src/App.js

+24-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from './selectors/nelson-api-selectors';
1313
import './style/App.css';
1414

15-
const DONATE_ADDR = 'SOZAIPJMQUBOFCTDTJJDXCZEKNIYZGIGVDLFMH9FFBAYK9SWGTBCWVUTFHXDOUESZAXRJJCJESJPIEQCCKBUTVQPOW';
15+
const DONATE_ADDR = 'YHZIJOENEFSDMZGZA9WOGFTRXOFPVFFCDEYEFHPUGKEUAOTTMVLPSSNZNHRJD99WAVESLFPSGLMTUEIBDZRKBKXWZD';
1616

1717
const propTypes = {
1818
getNelsonData: PropTypes.func.isRequired,
@@ -33,12 +33,18 @@ class App extends Component {
3333
this.state = {
3434
copied: false
3535
};
36+
this.startPoll = this.startPoll.bind(this);
37+
this.stopPoll = this.stopPoll.bind(this);
38+
this.restartPoll = this.restartPoll.bind(this);
39+
this.getAllNelsonData = this.getAllNelsonData.bind(this);
3640
}
3741

3842
componentDidMount () {
39-
this.startPoll();
4043
if (this.props.match.params.auth) {
4144
this.props.changeConnection(this.props.match.params);
45+
this.restartPoll(100);
46+
} else {
47+
this.startPoll(1)
4248
}
4349
}
4450

@@ -51,8 +57,7 @@ class App extends Component {
5157
(this.props.nelsonData !== nextProps.nelsonData || nextProps.nelsonDataError) ||
5258
(this.props.nelsonPeers !== nextProps.nelsonPeers || nextProps.nelsonPeersError)
5359
) {
54-
clearTimeout(this.timeout);
55-
this.startPoll();
60+
this.restartPoll();
5661
}
5762
}
5863

@@ -100,10 +105,21 @@ class App extends Component {
100105
setTimeout(() => this.setState({ copied: false }), 3000);
101106
}
102107

103-
startPoll () {
104-
this.timeout = setInterval(() => {
105-
this.props.getNelsonData().then(this.props.getNelsonPeers())
106-
}, this.props.updateInterval);
108+
startPoll (updateInterval) {
109+
this.timeout = setInterval(this.getAllNelsonData, updateInterval || this.props.updateInterval);
110+
}
111+
112+
restartPoll (updateInterval) {
113+
this.stopPoll();
114+
this.startPoll(updateInterval);
115+
}
116+
117+
stopPoll () {
118+
this.timeout && clearTimeout(this.timeout);
119+
}
120+
121+
getAllNelsonData () {
122+
this.props.getNelsonData().then(this.props.getNelsonPeers())
107123
}
108124
}
109125

src/selectors/nelson-api-selectors.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export const dataErrorSelect = createSelector(
3232
export const configSelect = createSelector(
3333
dataSelect,
3434
(data) => data ? data.config : {}
35-
)
35+
);
3636

3737
export const intervalSelect = createSelector(
3838
nelsonStoreSelect,
3939
configSelect,
4040
(nelson, config) => (config.beatInterval || nelson.updateInterval || 5) * 1000
41-
)
41+
);

0 commit comments

Comments
 (0)