refactor(extraSidebarComponent): refactor useContext hooks to destructure FlowsContext and typesContext for better readability
refactor(nodeToolbarComponent): refactor useContext hooks to destructure useStoreStore for better readability
This commit is contained in:
parent
34592f87e8
commit
538c7e01e9
2 changed files with 8 additions and 3 deletions
|
|
@ -29,9 +29,12 @@ import SidebarDraggableComponent from "./sideBarDraggableComponent";
|
||||||
export default function ExtraSidebar(): JSX.Element {
|
export default function ExtraSidebar(): JSX.Element {
|
||||||
const { data, templates, getFilterEdge, setFilterEdge } =
|
const { data, templates, getFilterEdge, setFilterEdge } =
|
||||||
useContext(typesContext);
|
useContext(typesContext);
|
||||||
const { flows, tabId, uploadFlow, saveFlow } = useContext(FlowsContext);
|
const { flows, tabId, uploadFlow, tabsState, saveFlow } =
|
||||||
|
useContext(FlowsContext);
|
||||||
|
|
||||||
const { hasStore, hasApiKey, validApiKey } = useStoreStore();
|
const hasStore = useStoreStore((state) => state.hasStore);
|
||||||
|
const hasApiKey = useStoreStore((state) => state.hasApiKey);
|
||||||
|
const validApiKey = useStoreStore((state) => state.validApiKey);
|
||||||
|
|
||||||
const { isBuilt, isPending } = useFlow();
|
const { isBuilt, isPending } = useFlow();
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export default function NodeToolbarComponent({
|
||||||
).length
|
).length
|
||||||
);
|
);
|
||||||
|
|
||||||
const { hasStore, hasApiKey, validApiKey } = useStoreStore();
|
const hasStore = useStoreStore((state) => state.hasStore);
|
||||||
|
const hasApiKey = useStoreStore((state) => state.hasApiKey);
|
||||||
|
const validApiKey = useStoreStore((state) => state.validApiKey);
|
||||||
|
|
||||||
function canMinimize() {
|
function canMinimize() {
|
||||||
let countHandles: number = 0;
|
let countHandles: number = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue