Skip to content

Commit aac7d33

Browse files
author
Alberto Iannaccone
committed
fix url to open sketch in cloud editor
1 parent 4e6f9ae commit aac7d33

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-contributions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export class CloudSketchbookContribution extends Contribution {
176176
registry.registerCommand(CloudSketchbookCommands.OPEN_IN_CLOUD_EDITOR, {
177177
execute: (arg) => {
178178
this.windowService.openNewWindow(
179-
`https://create.arduino.cc/editor/${arg.node.sketchId}`,
179+
`https://create.arduino.cc/editor/${arg.username}/${arg.node.sketchId}`,
180180
{ external: true }
181181
);
182182
},

arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-tree-widget.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ export class CloudSketchbookTreeWidget extends SketchbookTreeWidget {
9494
this.currentSketchUri === node.underlying?.toString())
9595
) {
9696
return Array.from(new Set(node.commands)).map((command) =>
97-
this.renderInlineCommand(command.id, node)
97+
this.renderInlineCommand(command.id, node, {
98+
username: this.authenticationService.session?.account?.label,
99+
})
98100
);
99101
}
100102
return undefined;

arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-tree-widget.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ export class SketchbookTreeWidget extends FileTreeWidget {
137137

138138
protected renderInlineCommand(
139139
commandId: string,
140-
node: SketchbookTree.SketchDirNode
140+
node: SketchbookTree.SketchDirNode,
141+
options?: any
141142
): React.ReactNode {
142143
const command = this.commandRegistry.getCommand(commandId);
143144
const icon = command?.iconClass;
144-
const args = { model: this.model, node: node };
145+
const args = { model: this.model, node: node, ...options };
145146
if (
146147
command &&
147148
icon &&

0 commit comments

Comments
 (0)