Skip to content

Commit

Permalink
Only show bug buttons if window.telemetry is present (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton authored Jan 7, 2024
1 parent 0dc72e2 commit dbf3234
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions frontend/packages/aquascope-embed/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,16 @@ window.initAquascopeBlocks = (root: HTMLElement) => {
let initialCode = maybeParseJson<string>(elem.dataset.code);
if (!initialCode) throw new Error("Missing data-code attribute");

let extraInfo = document.createElement("div");
elem.appendChild(extraInfo);
ReactDOM.createRoot(extraInfo).render(
<CodeContext.Provider value={initialCode}>
<ExtraInfo />
</CodeContext.Provider>
);

if (window.telemetry) {
let extraInfo = document.createElement("div");
elem.appendChild(extraInfo);
ReactDOM.createRoot(extraInfo).render(
<CodeContext.Provider value={initialCode}>
<ExtraInfo />
</CodeContext.Provider>
);
}

let serverUrl = elem.dataset.serverUrl
? new URL(elem.dataset.serverUrl)
: undefined;
Expand Down

0 comments on commit dbf3234

Please sign in to comment.