diff --git a/app/cyp.js b/app/cyp.js index 1570fcc..b5f3ed1 100644 --- a/app/cyp.js +++ b/app/cyp.js @@ -1644,8 +1644,8 @@ class Library extends Component { _popState() { this.selection.clear(); - this._stateStack.pop(); + if (this._stateStack.length > 0) { let state = this._stateStack[this._stateStack.length-1]; this._showState(state); @@ -1682,7 +1682,9 @@ class Library extends Component { } _pushState(state) { + this.selection.clear(); this._stateStack.push(state); + this._showState(state); } diff --git a/app/js/elements/library.js b/app/js/elements/library.js index 9801c8b..ed80443 100644 --- a/app/js/elements/library.js +++ b/app/js/elements/library.js @@ -48,8 +48,8 @@ class Library extends Component { _popState() { this.selection.clear(); - this._stateStack.pop(); + if (this._stateStack.length > 0) { let state = this._stateStack[this._stateStack.length-1]; this._showState(state); @@ -86,7 +86,9 @@ class Library extends Component { } _pushState(state) { + this.selection.clear(); this._stateStack.push(state); + this._showState(state); }