Skip to content

Commit

Permalink
fix: don't show bundle builder code until version is fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
vi-nastya committed May 5, 2021
1 parent 7090f46 commit 20e9200
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styles from './extension-selection.module.scss';

export const ExtensionSelection = () => {
const [selected, setSelected] = useState([]);
const [version, setVersion] = useState('v0.31.0');
const [version, setVersion] = useState(null);

const fetchLatestVersion = async (callback) => {
try {
Expand Down Expand Up @@ -35,15 +35,14 @@ export const ExtensionSelection = () => {
}
};

// TODO: always use most recent k6 version
let code = `$ xk6 build ${version}`;
selected.forEach((url) => {
code += ` --with ${url}`;
});

return (
<section className={styles.container}>
{code !== '' && (
{!!version && (
<div className={styles.selection}>
<WithCopyButton
dataToCopy={code.replace(/^\$\s/gm, '')}
Expand Down

0 comments on commit 20e9200

Please sign in to comment.