Revert "fix(client): also move the logic from the server to the client lol"

This reverts commit e401c8c930.
This commit is contained in:
Elian Doran
2025-06-12 21:46:27 +03:00
parent 79aae8fb43
commit f6bba436f4
5 changed files with 46 additions and 38 deletions

View File

@@ -8,7 +8,7 @@ import electronContextMenu from "./menus/electron_context_menu.js";
import glob from "./services/glob.js";
import { t } from "./services/i18n.js";
import options from "./services/options.js";
import { isRunningUnderRosetta2 } from "./services/rosetta_detection.js";
import server from "./services/server.js";
import type ElectronRemote from "@electron/remote";
import type Electron from "electron";
import "./stylesheets/bootstrap.scss";
@@ -119,12 +119,13 @@ function initDarkOrLightMode(style: CSSStyleDeclaration) {
nativeTheme.themeSource = themeSource;
}
function checkRosetta2Warning() {
async function checkRosetta2Warning() {
if (!utils.isElectron()) return;
try {
// Check if running under Rosetta 2 directly on client
if (isRunningUnderRosetta2()) {
// Check if running under Rosetta 2 by calling the server
const response = await server.get("api/system-info/rosetta-check") as { isRunningUnderRosetta2: boolean };
if (response.isRunningUnderRosetta2) {
// Trigger the Rosetta 2 warning dialog
appContext.triggerCommand("showRosettaWarning", {});
}