mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
refactor(cpu_dialog): more mentions of rosetta
This commit is contained in:
parent
c6c59c63bb
commit
9713864bb6
@ -10,19 +10,17 @@ export class StartupChecks extends Component {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.checkRosetta2Warning();
|
this.checkCpuArchMismatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkRosetta2Warning() {
|
async checkCpuArchMismatch() {
|
||||||
try {
|
try {
|
||||||
// Check if running under Rosetta 2 by calling the server
|
|
||||||
const response = await server.get("system-checks") as CpuArchResponse;
|
const response = await server.get("system-checks") as CpuArchResponse;
|
||||||
if (response.isCpuArchMismatch) {
|
if (response.isCpuArchMismatch) {
|
||||||
// Trigger the Rosetta 2 warning dialog
|
|
||||||
this.triggerCommand("showCpuArchWarning", {});
|
this.triggerCommand("showCpuArchWarning", {});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn("Could not check Rosetta 2 status:", error);
|
console.warn("Could not check CPU arch status:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ const TPL = /*html*/`
|
|||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
export default class RosettaWarningDialog extends BasicWidget {
|
export default class IncorrectCpuArchDialog extends BasicWidget {
|
||||||
private modal!: Modal;
|
private modal!: Modal;
|
||||||
private $downloadButton!: JQuery<HTMLElement>;
|
private $downloadButton!: JQuery<HTMLElement>;
|
||||||
|
|
||||||
|
@ -9,10 +9,9 @@ function systemChecks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects if the application is running under Rosetta 2 translation on Apple Silicon.
|
* Detects if the application is running under emulation on Apple Silicon or Windows on ARM.
|
||||||
* This happens when an x64 version of the app is run on an M1/M2/M3 Mac.
|
* This happens when an x64 version of the app is run on an M1/M2/M3 Mac or on a Windows Snapdragon chip.
|
||||||
* Uses the macOS sysctl.proc_translated to properly detect translation.
|
* @returns true if running on x86 emulation on ARM, false otherwise.
|
||||||
* @returns true if running under Rosetta 2, false otherwise
|
|
||||||
*/
|
*/
|
||||||
export const isCpuArchMismatch = () => {
|
export const isCpuArchMismatch = () => {
|
||||||
if (isMac) {
|
if (isMac) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user