mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-29 14:44:22 +00:00
Do not open first container if a tab is already open (#2045)
Co-authored-by: Laurent Nguyen <languye@microsoft.com>
This commit is contained in:
@@ -181,6 +181,11 @@ async function configureFabric(): Promise<Explorer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openFirstContainer = async (explorer: Explorer, databaseName: string, collectionName?: string) => {
|
const openFirstContainer = async (explorer: Explorer, databaseName: string, collectionName?: string) => {
|
||||||
|
if (useTabs.getState().openedTabs.length > 0) {
|
||||||
|
// Don't open any tabs if there are already tabs open
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Expand database first
|
// Expand database first
|
||||||
databaseName = sessionStorage.getItem("openDatabaseName") ?? databaseName;
|
databaseName = sessionStorage.getItem("openDatabaseName") ?? databaseName;
|
||||||
const database = useDatabases.getState().databases.find((db) => db.id() === databaseName);
|
const database = useDatabases.getState().databases.find((db) => db.id() === databaseName);
|
||||||
|
|||||||
Reference in New Issue
Block a user