diff --git a/packages/studio/src/components/DeployButton.tsx b/packages/studio/src/components/DeployButton.tsx index 1f575f36e..ceb6ac1fa 100644 --- a/packages/studio/src/components/DeployButton.tsx +++ b/packages/studio/src/components/DeployButton.tsx @@ -1,20 +1,24 @@ import useStudioStore from "../store/useStudioStore"; -import { useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useState, useMemo } from "react"; import gitData from "virtual_yext-studio-git-data"; import useHasChanges from "../hooks/useHasChanges"; import { Tooltip } from "react-tooltip"; -const canPush = gitData.canPush.status; +const canPush = gitData.canPush.status const tooltipAnchorID = "YextStudio-deployButton"; /** * Renders a button for saving, committing, and pushing changes. */ export default function DeployButton() { - const deploy = useStudioStore((store) => store.actions.deploy); + + const [deploy] = useStudioStore((store) => [ + store.actions.deploy, + // store.studioGitData.canPush.status + ]); const [deployInProgress, setDeployInProgress] = useState(false); const hasChanges = useHasChanges(); - + // const isDisabled = useMemo(() => deployInProgress || (!hasChanges && !canPush), [canPush, deployInProgress, hasChanges]); const handleClick = useCallback(() => { setDeployInProgress(true); void deploy(); @@ -42,20 +46,23 @@ export default function DeployButton() { const isDisabled = deployInProgress || (!hasChanges && !canPush); return ( - +