mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +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() {
|
||||
super();
|
||||
this.checkRosetta2Warning();
|
||||
this.checkCpuArchMismatch();
|
||||
}
|
||||
|
||||
async checkRosetta2Warning() {
|
||||
async checkCpuArchMismatch() {
|
||||
try {
|
||||
// Check if running under Rosetta 2 by calling the server
|
||||
const response = await server.get("system-checks") as CpuArchResponse;
|
||||
if (response.isCpuArchMismatch) {
|
||||
// Trigger the Rosetta 2 warning dialog
|
||||
this.triggerCommand("showCpuArchWarning", {});
|
||||
}
|
||||
} 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>`;
|
||||
|
||||
export default class RosettaWarningDialog extends BasicWidget {
|
||||
export default class IncorrectCpuArchDialog extends BasicWidget {
|
||||
private modal!: Modal;
|
||||
private $downloadButton!: JQuery<HTMLElement>;
|
||||
|
||||
|
@ -9,10 +9,9 @@ function systemChecks() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects if the application is running under Rosetta 2 translation on Apple Silicon.
|
||||
* This happens when an x64 version of the app is run on an M1/M2/M3 Mac.
|
||||
* Uses the macOS sysctl.proc_translated to properly detect translation.
|
||||
* @returns true if running under Rosetta 2, false otherwise
|
||||
* 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 or on a Windows Snapdragon chip.
|
||||
* @returns true if running on x86 emulation on ARM, false otherwise.
|
||||
*/
|
||||
export const isCpuArchMismatch = () => {
|
||||
if (isMac) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user