diff --git a/devtools/client/responsive/manager.js b/devtools/client/responsive/manager.js index a05c9859c83c..1790bc6d217f 100644 --- a/devtools/client/responsive/manager.js +++ b/devtools/client/responsive/manager.js @@ -86,12 +86,19 @@ class ResponsiveUIManager { * the UI has closed, there is no resolution value. */ toggle(window, tab, options = {}) { - const action = this.isActiveForTab(tab) ? "close" : "open"; - const completed = this[action + "IfNeeded"](window, tab, options); + const completed = this._toggleForTab(window, tab, options); completed.catch(console.error); return completed; } + _toggleForTab(window, tab, options) { + if (this.isActiveForTab(tab)) { + return this.closeIfNeeded(window, tab, options); + } + + return this.openIfNeeded(window, tab, options); + } + /** * Opens the responsive UI, if not already open. *