Skip to content

Commit

Permalink
hide extension import file button on platforms without file access
Browse files Browse the repository at this point in the history
  • Loading branch information
riknoll committed Nov 19, 2024
1 parent 0ef98af commit 3003140
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions webapp/src/extensionsBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
}

const categoryNames = getCategoryNames();
const showImportFile = pxt.BrowserUtils.hasFileAccess();

return (
<Modal
Expand Down Expand Up @@ -577,16 +578,18 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
}
</div>
}
<div className="import-button">
<Button
ariaLabel={(lf("Open file from your computer"))}
title={(lf("Import File"))}
label={(lf("Import File"))}
leftIcon="fas fa-upload"
className="gray"
onClick={importExtension}
/>
</div>
{showImportFile &&
<div className="import-button">
<Button
ariaLabel={(lf("Open file from your computer"))}
title={(lf("Import File"))}
label={(lf("Import File"))}
leftIcon="fas fa-upload"
className="gray"
onClick={importExtension}
/>
</div>
}
</div>
{displayMode == ExtensionView.Search &&
<>
Expand Down

0 comments on commit 3003140

Please sign in to comment.