mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): do not attempt toggle when target panel isn't registered
This commit is contained in:
@@ -609,13 +609,21 @@ export class NavigationApi {
|
||||
const prevActiveDockviewPanel = this._prevActiveDockviewPanel.get(activeTab);
|
||||
const currentActiveDockviewPanel = this._currentActiveDockviewPanel.get(activeTab);
|
||||
|
||||
let targetPanel;
|
||||
|
||||
if (currentActiveDockviewPanel !== VIEWER_PANEL_ID) {
|
||||
return this.focusPanelInActiveTab(VIEWER_PANEL_ID);
|
||||
targetPanel = VIEWER_PANEL_ID;
|
||||
} else if (prevActiveDockviewPanel && prevActiveDockviewPanel !== VIEWER_PANEL_ID) {
|
||||
return this.focusPanelInActiveTab(prevActiveDockviewPanel);
|
||||
targetPanel = prevActiveDockviewPanel;
|
||||
} else {
|
||||
return this.focusPanelInActiveTab(LAUNCHPAD_PANEL_ID);
|
||||
targetPanel = LAUNCHPAD_PANEL_ID;
|
||||
}
|
||||
|
||||
if (this.getRegisteredPanels(activeTab).includes(targetPanel)) {
|
||||
return this.focusPanel(activeTab, targetPanel);
|
||||
}
|
||||
|
||||
return Promise.resolve(false);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user