Skip to content

Commit

Permalink
Fix disconnecting port problems (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
saltict committed May 24, 2024
1 parent 83d8e88 commit 765c002
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/extension-koni/src/helper/ActionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class ActionHandler {
}

if (this.sleepTimeout) {
console.debug('Clearing sleep timeout');
clearTimeout(this.sleepTimeout);
this.sleepTimeout = undefined;
}
Expand All @@ -94,6 +95,7 @@ export class ActionHandler {

// Set timeout to sleep
if (Object.keys(this.connectionMap).length === 0) {
console.debug('Every port is disconnected, set timeout to sleep');
this.sleepTimeout && clearTimeout(this.sleepTimeout);
this.sleepTimeout = setTimeout(() => {
// Reset active status
Expand Down

1 comment on commit 765c002

@saltict
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.