Skip to content

Commit

Permalink
fix file download in download menu (#10408)
Browse files Browse the repository at this point in the history
  • Loading branch information
srietkerk authored Mar 7, 2025
1 parent 98a6d2d commit bf2278e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/src/editortoolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ export class EditorToolbar extends data.Component<ISettingsProps, EditorToolbarS
this.compile();
}

protected onHwDownloadClick = () => {
protected onFileDownloadClick = async () => {
// Matching the tick in the call to compile() above for historical reasons
pxt.tickEvent("editortools.download", { collapsed: this.getCollapsedState() }, { interactiveConsent: true });
pxt.tickEvent("editortools.downloadasfile", { collapsed: this.getCollapsedState() }, { interactiveConsent: true });
(this.props.parent as ProjectView).compile(true);
await (this.props.parent as ProjectView).saveProjectToFileAsync();
}

protected onPairClick = () => {
Expand Down Expand Up @@ -344,7 +344,7 @@ export class EditorToolbar extends data.Component<ISettingsProps, EditorToolbarS
{showUsbNotSupportedHint && <sui.Item role="menuitem" icon={usbIcon} text={lf("Connect Device")} tabIndex={-1} onClick={this.onCannotPairClick} />}
{webUSBSupported && (packetioConnecting || packetioConnected) && <sui.Item role="menuitem" icon={usbIcon} text={lf("Disconnect")} tabIndex={-1} onClick={this.onDisconnectClick} />}
{boards && <sui.Item role="menuitem" icon="microchip" text={hardwareMenuText} tabIndex={-1} onClick={this.onHwItemClick} />}
<sui.Item role="menuitem" icon="xicon file-download" text={downloadMenuText} tabIndex={-1} onClick={this.onHwDownloadClick} />
<sui.Item role="menuitem" icon="xicon file-download" text={downloadMenuText} tabIndex={-1} onClick={this.onFileDownloadClick} />
{downloadHelp && <sui.Item role="menuitem" icon="help circle" text={lf("Help")} tabIndex={-1} onClick={this.onHelpClick} />}
</sui.DropdownMenu>
)
Expand Down

0 comments on commit bf2278e

Please sign in to comment.