Skip to content

Commit

Permalink
Fix error can not keep alive on external tab
Browse files Browse the repository at this point in the history
  • Loading branch information
saltict committed Jun 21, 2024
1 parent 11c5acc commit 588eb9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/extension-koni/src/helper/ActionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export class ActionHandler {
// Set timeout to sleep
if (Object.keys(this.connectionMap).length === 0) {
console.debug('Every port is disconnected, set timeout to sleep');
// Reset active status
this.isActive = false;
this.sleepTimeout && clearTimeout(this.sleepTimeout);
this.sleepTimeout = setTimeout(() => {
// Reset active status
this.isActive = false;
this.waitActiveHandler = createPromiseHandler<boolean>();
this.mainHandler && this.mainHandler.state.sleep().catch(console.error);
}, SLEEP_TIMEOUT);
Expand Down

2 comments on commit 588eb9c

@saltict
Copy link
Author

Choose a reason for hiding this comment

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

@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.