Skip to content

Commit 4a54954

Browse files
authored
[stable12.2] offline app cherry picks (#11182)
* Fix report abuse in electron app (#11178) * fix share homescreen content in electron * remove recommended for mac offline since it's not accurately detecting * do not recommend at all for now Comment out Windows ARM download logic and set recommendedButton to null.
1 parent 5450bc0 commit 4a54954

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

docfiles/offline-app-head.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -530,17 +530,15 @@
530530
let recommendedButton = null;
531531

532532
if (isMac) {
533-
if (isAppleSilicon) {
534-
recommendedButton = $("#download-macarm64");
535-
} else {
536-
recommendedButton = $("#download-mac64");
537-
}
533+
// Do not recommend a Mac binary because architecture detection is unreliable across browsers
534+
recommendedButton = null;
538535
} else if (isWindows) {
539-
if (false && isWindowsARM) {
540-
recommendedButton = $("#download-winarm64");
541-
} else {
542-
recommendedButton = $("#download-win64");
543-
}
536+
// if (false && isWindowsARM) {
537+
// recommendedButton = $("#download-winarm64");
538+
// } else {
539+
// recommendedButton = $("#download-win64");
540+
// }
541+
recommendedButton = null;
544542
}
545543

546544
// Mark the recommended download

webapp/src/dialogs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ export function showReportAbuseAsync(pubId?: string) {
701701
core.infoNotification(lf("Sending abuse report..."));
702702
Cloud.privatePostAsync(`${id}/abusereports`, {
703703
text: reasonInput.value
704-
})
704+
}, true)
705705
.then(res => {
706706
core.infoNotification(lf("Report sent. Thank you!"))
707707
})
@@ -949,4 +949,4 @@ export async function showTurnBackTimeDialogAsync(header: pxt.workspace.Header,
949949
/>
950950
)
951951
})
952-
}
952+
}

webapp/src/projects.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,8 +1076,12 @@ export class ProjectsDetail extends data.Component<ProjectsDetailProps, Projects
10761076
const { cardType, url, scr } = this.props;
10771077
if (!cardType) return undefined;
10781078

1079-
const relPrefix = pxt.webConfig?.relprefix?.replace(/-+$/, "");
1080-
const baseUrl = `${window.location.origin}${relPrefix}`;
1079+
const relPrefix = (pxt.webConfig?.relprefix || "").replace(/-+$/, "");
1080+
const liveBaseUrl = (pxt.appTarget?.appTheme?.embedUrl || pxt.appTarget?.appTheme?.homeUrl || "").replace(/\/+$/, "");
1081+
const defaultBaseUrl = `${window.location.origin}${relPrefix}`;
1082+
const baseUrl = pxt.BrowserUtils.isPxtElectron() && liveBaseUrl
1083+
? `${liveBaseUrl}${relPrefix}`
1084+
: defaultBaseUrl;
10811085

10821086
const cardUrl = (scr?.url || url) as string;
10831087
const defaultEditor = this.getActionEditor(cardType, undefined);

0 commit comments

Comments
 (0)