diff --git a/editor/dialogs.tsx b/editor/dialogs.tsx index a943d59f92b..0560df83883 100644 --- a/editor/dialogs.tsx +++ b/editor/dialogs.tsx @@ -16,7 +16,18 @@ export function cantImportAsync(project: pxt.editor.IProjectView) { export async function showProgramTooLargeErrorAsync(variants: string[], confirmAsync: (opts: any) => Promise, 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