mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-28 06:04:25 +00:00
Move selectedNode to zustand (#903)
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
import Explorer from "../../Explorer";
|
||||
import { NewQueryTab } from "../../Tabs/QueryTab/QueryTab";
|
||||
import { useDatabases } from "../../useDatabases";
|
||||
import { useSelectedNode } from "../../useSelectedNode";
|
||||
|
||||
interface BrowseQueriesPaneProps {
|
||||
explorer: Explorer;
|
||||
@@ -24,7 +25,7 @@ export const BrowseQueriesPane: FunctionComponent<BrowseQueriesPaneProps> = ({
|
||||
}: BrowseQueriesPaneProps): JSX.Element => {
|
||||
const closeSidePanel = useSidePanel((state) => state.closeSidePanel);
|
||||
const loadSavedQuery = (savedQuery: Query): void => {
|
||||
const selectedCollection: Collection = explorer && explorer.findSelectedCollection();
|
||||
const selectedCollection: Collection = useSelectedNode.getState().findSelectedCollection();
|
||||
if (!selectedCollection) {
|
||||
// should never get into this state because this pane is only accessible through the query tab
|
||||
logError("No collection was selected", "BrowseQueriesPane.loadSavedQuery");
|
||||
|
||||
Reference in New Issue
Block a user