1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop: Fixes #11989: Joplin became unusably slow on MacOS due to incorrect detection of architecture

This commit is contained in:
Laurent Cozic
2025-03-21 11:55:53 +01:00
parent 20f7f37b49
commit 2142373fff
5 changed files with 56 additions and 1 deletions

View File

@@ -156,6 +156,12 @@ const shim = {
return typeof process !== 'undefined' && process.platform === 'darwin';
},
// Tells whether the computer **CPU** is an Apple Silicon (not whether the running version was
// built for ARM64)
isAppleSilicon: (): boolean => {
throw new Error('Not implemented: isAppleSilicon');
},
platformName: () => {
if (shim.isReactNative()) return shim.mobilePlatform();
if (shim.isMac()) return 'darwin';
@@ -166,6 +172,23 @@ const shim = {
throw new Error('Cannot determine platform');
},
// Tells the computer CPU architecture. Which if different from the architecture the running
// version was built for. For example, the laptop CPU may be an ARM64, while the version was
// built for x64 architecture. Here we want to know the laptop CPU.
platformArch: (): string => {
throw new Error('Not implemented: platformArch');
},
deviceString: () => {
const output: string[] = [];
output.push(shim.platformName());
if (shim.platformArch()) output.push(shim.platformArch());
return output.join(', ');
},
// "ios" or "android", or "" if not on mobile
mobilePlatform: () => {
return ''; // Default if we're not on mobile (React Native)