@@ -24,6 +24,8 @@ export class MonitorManager extends CoreClientAware {
24
24
@inject ( MonitorServiceFactory )
25
25
private monitorServiceFactory : MonitorServiceFactory ;
26
26
27
+ uploading = false ;
28
+
27
29
constructor (
28
30
@inject ( ILogger )
29
31
@named ( MonitorManagerName )
@@ -57,6 +59,9 @@ export class MonitorManager extends CoreClientAware {
57
59
* started or if there have been errors.
58
60
*/
59
61
async startMonitor ( board : Board , port : Port ) : Promise < Status > {
62
+ if ( this . uploading ) {
63
+ return Status . UPLOAD_IN_PROGRESS ;
64
+ }
60
65
const monitorID = this . monitorID ( board , port ) ;
61
66
let monitor = this . monitorServices . get ( monitorID ) ;
62
67
if ( ! monitor ) {
@@ -106,6 +111,7 @@ export class MonitorManager extends CoreClientAware {
106
111
* @param port port to monitor
107
112
*/
108
113
async notifyUploadStarted ( board ?: Board , port ?: Port ) : Promise < void > {
114
+ this . uploading = true ;
109
115
if ( ! board || ! port ) {
110
116
// We have no way of knowing which monitor
111
117
// to retrieve if we don't have this information.
@@ -130,6 +136,7 @@ export class MonitorManager extends CoreClientAware {
130
136
* started or if there have been errors.
131
137
*/
132
138
async notifyUploadFinished ( board ?: Board , port ?: Port ) : Promise < Status > {
139
+ this . uploading = false ;
133
140
if ( ! board || ! port ) {
134
141
// We have no way of knowing which monitor
135
142
// to retrieve if we don't have this information.
0 commit comments