refactor(client): relocate architecture mismatch checks

This commit is contained in:
Elian Doran
2025-06-12 21:59:59 +03:00
parent f6bba436f4
commit b4d2d21620
3 changed files with 33 additions and 20 deletions

View File

@@ -0,0 +1,23 @@
import server from "../services/server";
import Component from "./component";
export class StartupChecks extends Component {
constructor() {
super();
this.checkRosetta2Warning();
}
async checkRosetta2Warning() {
try {
// Check if running under Rosetta 2 by calling the server
const response = await server.get("system-info/rosetta-check") as { isRunningUnderRosetta2: boolean };
if (response.isRunningUnderRosetta2) {
// Trigger the Rosetta 2 warning dialog
this.triggerCommand("showRosettaWarning", {});
}
} catch (error) {
console.warn("Could not check Rosetta 2 status:", error);
}
}
}