Skip to content

Commit

Permalink
fix(#2): add buffer time to reload the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
isaurssaurav committed Oct 28, 2023
1 parent 72e6a06 commit ea252ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ const hotReloadExtension = (options: hotReloadExtensionOptions): Plugin => {
chalkLogger.red('Load extension to browser...');
return;
}
// TODO BUG: when user triggers watch before previous build is completed, the extension crashes
ws?.send(Message.FILE_CHANGE);
if (log) chalkLogger.green('Extension Reloaded...');

setTimeout(()=>{
ws?.send(Message.FILE_CHANGE);
if (log) chalkLogger.green('Extension Reloaded...');
}, 1000)
}
};
};
Expand Down

0 comments on commit ea252ea

Please sign in to comment.