Skip to content

Commit c310f34

Browse files
committed
apple silicon as primary download
1 parent b2c7493 commit c310f34

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

i18n/react-intl/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"raspberryPi32AssetTooltip": "Latest version of Raspberry Pi OS is recommended.",
8484
"raspberryPi64AssetTooltip": "Latest version of Raspberry Pi OS is recommended. The 64-bit release Raspberry Pi OS is newer, so if you have issues, try the 32-bit version.",
8585
"publishedOn": "Published on",
86-
"macOsIntelWarning": "Got an M1 or above? Download the <a href='{0}'>Apple Silicon</a> version instead.",
86+
"macOsIntelWarning": "Got a mac with an Intel Processor? Download the <a href='{0}'>Intel version</a> instead.",
8787
"otherVersions": "Need another version?",
8888
"olderVersions": "Looking for older versions?",
8989
"githubEarlierReleases": "Head over to GitHub for <a href='https://github.com/processing/processing4/releases'>earlier releases of Processing 4</a>.",

src/hooks/download.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ export const usePreparedReleases = (releases) => {
9595
for (let os in item.assetsByOs) {
9696
item.assetsByOs[os].sort((a, b) => {
9797
if (a.bit === b.bit) return 0;
98-
if (a.bit != null && a.bit.includes('Intel')) return -1;
99-
if (b.bit != null && b.bit.includes('Intel')) return 1;
98+
if (a.bit != null && a.bit.includes('Intel')) return 1;
99+
if (b.bit != null && b.bit.includes('Intel')) return -1;
100100
return 0;
101101
});
102102
}

src/templates/download.js

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,7 @@ const MainDownloadSection = memo(({ release, onAfterDownload }) => {
190190
const intl = useIntl();
191191
const detectedAsset = useMachineOS(release.assetsByOs, release.publishedAt);
192192

193-
const appleSiliconAsset = useMemo(() => {
194-
for (let asset of release.assets) {
195-
if (asset.bit === 'Apple Silicon') return asset;
196-
}
197-
return null;
198-
}, [release]);
193+
const appleSiliconAsset = useMemo(() => release.assets.find(asset => asset.os === "macOS" && asset.bit === "Intel 64-bit"), [release]);
199194

200195
return (
201196
<div className={classnames(grid.container, grid.grid)}>
@@ -234,20 +229,18 @@ const MainDownloadSection = memo(({ release, onAfterDownload }) => {
234229
/>
235230
</div>
236231
)}
237-
{detectedAsset.asset &&
238-
detectedAsset.asset.name.includes('macos-x64') &&
239-
appleSiliconAsset && (
240-
<div>
241-
<p
242-
className={css.appleSiliconWarning}
243-
dangerouslySetInnerHTML={{
244-
__html: intl
245-
.formatMessage({ id: 'macOsIntelWarning' })
246-
.replace('{0}', appleSiliconAsset.url)
247-
}}
248-
/>
249-
</div>
250-
)}
232+
{appleSiliconAsset && (
233+
<div>
234+
<p
235+
className={css.appleSiliconWarning}
236+
dangerouslySetInnerHTML={{
237+
__html: intl
238+
.formatMessage({ id: 'macOsIntelWarning' })
239+
.replace('{0}', appleSiliconAsset.url)
240+
}}
241+
/>
242+
</div>
243+
)}
251244
</div>
252245
</div>
253246
);

0 commit comments

Comments
 (0)