|
@@ -44,6 +44,7 @@ class App extends Component {
|
|
manifests: [],
|
|
manifests: [],
|
|
readyToFlash: false,
|
|
readyToFlash: false,
|
|
isFlashing: false,
|
|
isFlashing: false,
|
|
|
|
+ firstRun: true,
|
|
percent: 100,
|
|
percent: 100,
|
|
status: 'Finding ports and manifests...'
|
|
status: 'Finding ports and manifests...'
|
|
};
|
|
};
|
|
@@ -64,9 +65,15 @@ class App extends Component {
|
|
}
|
|
}
|
|
|
|
|
|
currentClass() {
|
|
currentClass() {
|
|
- return this.state.isFlashing ? 'flashing' : 'finished';
|
|
|
|
|
|
+ if (this.state.firstRun) {
|
|
|
|
+ return '';
|
|
|
|
+ } else {
|
|
|
|
+ return this.state.isFlashing ? 'flashing' : 'finished';
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
prepareEventHandlers() {
|
|
prepareEventHandlers() {
|
|
ipcRenderer.on('portsFound', (event, ports) => this.portsFound(ports));
|
|
ipcRenderer.on('portsFound', (event, ports) => this.portsFound(ports));
|
|
ipcRenderer.on('noPortError', (event, error) => {
|
|
ipcRenderer.on('noPortError', (event, error) => {
|
|
@@ -91,7 +98,7 @@ class App extends Component {
|
|
|
|
|
|
ipcRenderer.on('flashProgress', (event, progress) => {
|
|
ipcRenderer.on('flashProgress', (event, progress) => {
|
|
const {percent, message} = progress;
|
|
const {percent, message} = progress;
|
|
- let humanReadablePercent = Math.round(percent * 100);
|
|
|
|
|
|
+ let humanReadablePercent = Math.round(percent * 100);
|
|
|
|
|
|
this.setState({
|
|
this.setState({
|
|
percent: humanReadablePercent,
|
|
percent: humanReadablePercent,
|
|
@@ -195,7 +202,7 @@ class App extends Component {
|
|
}
|
|
}
|
|
|
|
|
|
flash() {
|
|
flash() {
|
|
- this.setState({ isFlashing: true });
|
|
|
|
|
|
+ this.setState({ isFlashing: true, firstRun: false });
|
|
ipcRenderer.send('flash', this.state.selectedPort, this.state.selectedManifest);
|
|
ipcRenderer.send('flash', this.state.selectedPort, this.state.selectedManifest);
|
|
}
|
|
}
|
|
|
|
|