Move databases to zustand (#898)

This commit is contained in:
victor-meng
2021-06-18 11:25:08 -07:00
committed by GitHub
parent c9fa44f6f4
commit 96e6bba38b
33 changed files with 310 additions and 446 deletions

View File

@@ -10,6 +10,7 @@ import { MessageTypes } from "../Contracts/ExplorerContracts";
import { DataExplorerInputsFrame } from "../Contracts/ViewModels";
import Explorer, { ExplorerParams } from "../Explorer/Explorer";
import { handleOpenAction } from "../Explorer/OpenActions/OpenActions";
import { useDatabases } from "../Explorer/useDatabases";
import {
AAD,
ConnectionString,
@@ -253,7 +254,7 @@ async function configurePortal(explorerParams: ExplorerParams): Promise<Explorer
const explorer = new Explorer(explorerParams);
resolve(explorer);
if (openAction) {
handleOpenAction(openAction, explorer.databases(), explorer);
handleOpenAction(openAction, useDatabases.getState().databases, explorer);
}
} else if (shouldForwardMessage(message, event.origin)) {
sendMessage(message);