Skip to content

Commit

Permalink
add dialog for when program too big for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl committed Aug 13, 2024
1 parent 01f4333 commit d600d73
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion editor/dialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ export function cantImportAsync(project: pxt.editor.IProjectView) {


export async function showProgramTooLargeErrorAsync(variants: string[], confirmAsync: (opts: any) => Promise<number>, saveOnly?: boolean) {
if (variants.length !== 2) return undefined;
if (variants.length !== 2) {
if (variants[0] !== "mbcodal") return undefined;
await confirmAsync({
header: lf("Oops, there was a problem downloading your code"),
body: lf("Great coding skills! Unfortunately, your program is too large to fit on a micro:bit V2😢. You can go back and try to make your program smaller, or continue to use the simulator to run your code."),
bigHelpButton: true,
agreeLbl: lf("Go Back"),
agreeClass: "positive",
agreeIcon: "cancel",
});
return undefined
}

if (pxt.packetio.isConnected() && pxt.packetio.deviceVariant() === "mbcodal" && !saveOnly) {
// connected micro:bit V2 will be flashed; don't give warning dialog
Expand Down

0 comments on commit d600d73

Please sign in to comment.