refactor(client,server): rebrand to CPU arch warnings

This commit is contained in:
Elian Doran
2025-06-12 22:16:57 +03:00
parent db3c008c07
commit 8edbbe27f8
8 changed files with 54 additions and 53 deletions

View File

@@ -1,6 +1,11 @@
import server from "../services/server";
import Component from "./component";
// TODO: Deduplicate.
interface CpuArchResponse {
isCpuArchMismatch: boolean;
}
export class StartupChecks extends Component {
constructor() {
@@ -11,10 +16,10 @@ export class StartupChecks extends Component {
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) {
const response = await server.get("system-checks") as CpuArchResponse;
if (response.isCpuArchMismatch) {
// Trigger the Rosetta 2 warning dialog
this.triggerCommand("showRosettaWarning", {});
this.triggerCommand("showCpuArchWarning", {});
}
} catch (error) {
console.warn("Could not check Rosetta 2 status:", error);