mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
refactor(client): relocate architecture mismatch checks
This commit is contained in:
23
apps/client/src/components/startup_checks.ts
Normal file
23
apps/client/src/components/startup_checks.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user