@@ -24,6 +24,8 @@ export class MonitorManager extends CoreClientAware {
2424 @inject ( MonitorServiceFactory )
2525 private monitorServiceFactory : MonitorServiceFactory ;
2626
27+ uploading = false ;
28+
2729 constructor (
2830 @inject ( ILogger )
2931 @named ( MonitorManagerName )
@@ -57,6 +59,9 @@ export class MonitorManager extends CoreClientAware {
5759 * started or if there have been errors.
5860 */
5961 async startMonitor ( board : Board , port : Port ) : Promise < Status > {
62+ if ( this . uploading ) {
63+ return Status . UPLOAD_IN_PROGRESS ;
64+ }
6065 const monitorID = this . monitorID ( board , port ) ;
6166 let monitor = this . monitorServices . get ( monitorID ) ;
6267 if ( ! monitor ) {
@@ -106,6 +111,7 @@ export class MonitorManager extends CoreClientAware {
106111 * @param port port to monitor
107112 */
108113 async notifyUploadStarted ( board ?: Board , port ?: Port ) : Promise < void > {
114+ this . uploading = true ;
109115 if ( ! board || ! port ) {
110116 // We have no way of knowing which monitor
111117 // to retrieve if we don't have this information.
@@ -130,6 +136,7 @@ export class MonitorManager extends CoreClientAware {
130136 * started or if there have been errors.
131137 */
132138 async notifyUploadFinished ( board ?: Board , port ?: Port ) : Promise < Status > {
139+ this . uploading = false ;
133140 if ( ! board || ! port ) {
134141 // We have no way of knowing which monitor
135142 // to retrieve if we don't have this information.
0 commit comments