Skip to content

Commit

Permalink
stop reopning Find sidebar if it's already opened
Browse files Browse the repository at this point in the history
  • Loading branch information
beru committed Sep 22, 2024
1 parent 937341f commit 6c0d706
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ view.View = class {

find() {
if (this._graph) {
if (this._sidebar.isOpened('Find')) {
return;
}
this._graph.select(null);
const sidebar = new view.FindSidebar(this, this.activeGraph, this.activeSignature);
sidebar.on('state-changed', (sender, state) => {
Expand Down Expand Up @@ -2467,6 +2470,10 @@ view.Sidebar = class {
this._update([entry]);
}

isOpened(title) {
return this._stack.length > 0 && this._stack[0].title === title;
}

close() {
this._update([]);
}
Expand Down

0 comments on commit 6c0d706

Please sign in to comment.