Skip to content

Commit 5897f37

Browse files
author
Alberto Iannaccone
authored
fix url to open sketch in cloud editor (#452)
1 parent d790266 commit 5897f37

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Diff for: 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
},

Diff for: 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.uri.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;

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

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

126126
protected renderInlineCommand(
127127
commandId: string,
128-
node: SketchbookTree.SketchDirNode
128+
node: SketchbookTree.SketchDirNode,
129+
options?: any
129130
): React.ReactNode {
130131
const command = this.commandRegistry.getCommand(commandId);
131132
const icon = command?.iconClass;
132-
const args = { model: this.model, node: node };
133+
const args = { model: this.model, node: node, ...options };
133134
if (
134135
command &&
135136
icon &&

0 commit comments

Comments
 (0)