Skip to content

Commit

Permalink
Fix reject 'Control comm was closed too early' when comm closed as ex…
Browse files Browse the repository at this point in the history
…pected.
  • Loading branch information
Alan Fleming committed Mar 10, 2024
1 parent ae6df72 commit 200edee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/base-manager/src/manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,10 @@ export abstract class ManagerBase implements IWidgetManager {
resolve(null);
});

initComm.on_close(() => reject('Control comm was closed too early'));
initComm.on_close(() => {
if (data.method !== 'update_states')
reject('Control comm was closed too early');
});

// Send a states request msg
initComm.send({ method: 'request_states' }, {});
Expand Down

0 comments on commit 200edee

Please sign in to comment.