Skip to content

Commit 3f826be

Browse files
authored
fix: remove panel visibility listener on deactivate (#38)
1 parent e05efa5 commit 3f826be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/minimap-find-and-replace.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ module.exports = {
7171
const [fnrPanel] = atom.workspace.getBottomPanels().filter(panel => panel.element.firstChild.classList.contains('find-and-replace'))
7272

7373
if (fnrPanel) {
74-
this.changeVisible(true)
75-
fnrPanel.onDidChangeVisible((visible) => {
74+
this.changeVisible(fnrPanel.isVisible())
75+
this.subscriptions.add(fnrPanel.onDidChangeVisible((visible) => {
7676
this.changeVisible(visible)
77-
})
77+
}))
7878
} else {
7979
if (retry < 10) {
8080
setTimeout(() => this.setOnChangeVisibility(retry + 1), 100)

0 commit comments

Comments
 (0)