mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 14:26:37 +00:00
fix url to open sketch in cloud editor (#452)
This commit is contained in:
parent
d790266cc8
commit
5897f379a4
@ -176,7 +176,7 @@ export class CloudSketchbookContribution extends Contribution {
|
|||||||
registry.registerCommand(CloudSketchbookCommands.OPEN_IN_CLOUD_EDITOR, {
|
registry.registerCommand(CloudSketchbookCommands.OPEN_IN_CLOUD_EDITOR, {
|
||||||
execute: (arg) => {
|
execute: (arg) => {
|
||||||
this.windowService.openNewWindow(
|
this.windowService.openNewWindow(
|
||||||
`https://create.arduino.cc/editor/${arg.node.sketchId}`,
|
`https://create.arduino.cc/editor/${arg.username}/${arg.node.sketchId}`,
|
||||||
{ external: true }
|
{ external: true }
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -94,7 +94,9 @@ export class CloudSketchbookTreeWidget extends SketchbookTreeWidget {
|
|||||||
this.currentSketchUri === node.uri.toString())
|
this.currentSketchUri === node.uri.toString())
|
||||||
) {
|
) {
|
||||||
return Array.from(new Set(node.commands)).map((command) =>
|
return Array.from(new Set(node.commands)).map((command) =>
|
||||||
this.renderInlineCommand(command.id, node)
|
this.renderInlineCommand(command.id, node, {
|
||||||
|
username: this.authenticationService.session?.account?.label,
|
||||||
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -125,11 +125,12 @@ export class SketchbookTreeWidget extends FileTreeWidget {
|
|||||||
|
|
||||||
protected renderInlineCommand(
|
protected renderInlineCommand(
|
||||||
commandId: string,
|
commandId: string,
|
||||||
node: SketchbookTree.SketchDirNode
|
node: SketchbookTree.SketchDirNode,
|
||||||
|
options?: any
|
||||||
): React.ReactNode {
|
): React.ReactNode {
|
||||||
const command = this.commandRegistry.getCommand(commandId);
|
const command = this.commandRegistry.getCommand(commandId);
|
||||||
const icon = command?.iconClass;
|
const icon = command?.iconClass;
|
||||||
const args = { model: this.model, node: node };
|
const args = { model: this.model, node: node, ...options };
|
||||||
if (
|
if (
|
||||||
command &&
|
command &&
|
||||||
icon &&
|
icon &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user