Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Nov 18, 2024
1 parent dad9886 commit 2e788a2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
7 changes: 6 additions & 1 deletion chrome/public/bundle/detector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion chrome/public/bundle/hook.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion chrome/public/bundle/panel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion chrome/public/bundle/proxy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion chrome/public/bundle/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion packages/core/src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export class DevToolCore {

_state = {};

_needUnmount = false;

_enabled = false;

_enableHover = false;
Expand Down Expand Up @@ -167,6 +169,8 @@ export class DevToolCore {
const onUnmount = () => {
// if (!this.hasEnable) return;

this._needUnmount = true;

this.delDispatch(dispatch);
};

Expand Down Expand Up @@ -485,7 +489,10 @@ export class DevToolCore {
notifyAll = debounce(() => {
this.notifyDetector();

this._notify({ type: DevToolMessageEnum.unmount, data: null });
if (this._needUnmount) {
this._notify({ type: DevToolMessageEnum.unmount, data: null });
this._needUnmount = false;
}

if (this._dispatch.size) {
this._dispatch.forEach((dispatch) => {
Expand Down

0 comments on commit 2e788a2

Please sign in to comment.