Skip to content

Commit 287ae9b

Browse files
committed
Stop listening to IPC on Todos
1 parent 9883707 commit 287ae9b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/features/todos/components/TodosWebview.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class TodosWebview extends Component<IProps, IState> {
110110
this.node.current.removeEventListener('mouseup', this.stopResize);
111111
this.node.current.removeEventListener('mouseleave', this.stopResize);
112112
}
113+
114+
this.stopListeningToIpcMessages();
113115
}
114116

115117
startResize = (e: MouseEvent<HTMLDivElement>): void => {
@@ -165,6 +167,15 @@ class TodosWebview extends Component<IProps, IState> {
165167
});
166168
};
167169

170+
stopListeningToIpcMessages = (): void => {
171+
if (!this.webview) {
172+
return;
173+
}
174+
175+
const { handleClientMessage } = this.props;
176+
this.webview.removeEventListener('ipc-message', handleClientMessage);
177+
};
178+
168179
render(): ReactElement {
169180
const {
170181
classes,

0 commit comments

Comments
 (0)