Skip to content

Commit

Permalink
fix: failure on no docs and no install plan
Browse files Browse the repository at this point in the history
  • Loading branch information
rudouglas committed Dec 17, 2021
1 parent 83b86be commit e7c00f0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/InstallButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ const InstallButton = ({ quickstart, location, ...props }) => {
quickstart.installPlans.length === 1 &&
quickstart.installPlans[0].id.includes('guided-install');

const [installUrl, setInstallUrl] = useState(SIGNUP_LINK);
useEffect(() => {
setInstallUrl(url);

// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

// If there is nothing to install AND no documentation, don't show this button.
if (!hasInstallableComponent && !hasComponent(quickstart, 'documentation')) {
return null;
}

let nerdletId = hasGuidedInstall
? NR1_GUIDED_INSTALL_NERDLET
: NR1_PACK_DETAILS_NERDLET;
Expand All @@ -127,18 +139,6 @@ const InstallButton = ({ quickstart, location, ...props }) => {
)
: quickstart.documentation[0].url;

const [installUrl, setInstallUrl] = useState(SIGNUP_LINK);
useEffect(() => {
setInstallUrl(url);

// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

// If there is nothing to install AND no documentation, don't show this button.
if (!hasInstallableComponent && !hasComponent(quickstart, 'documentation')) {
return null;
}

const writeCookie = () => {
const currentEnvironment =
process.env.ENV || process.env.NODE_ENV || 'development';
Expand Down

0 comments on commit e7c00f0

Please sign in to comment.