mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-26 16:11:14 +08:00
e9833e9a57
- Enhanced error messages in Rust backend to include file paths - Improved provider switching error handling with detailed messages - Added MCP button placeholder in UI (functionality TODO) - Applied code formatting across frontend components - Extended error notification duration to 6s for better readability
30 lines
786 B
TypeScript
30 lines
786 B
TypeScript
import React from "react";
|
||
import ReactDOM from "react-dom/client";
|
||
import App from "./App";
|
||
import { UpdateProvider } from "./contexts/UpdateContext";
|
||
import "./index.css";
|
||
// 导入 Tauri API(自动绑定到 window.api)
|
||
import "./lib/tauri-api";
|
||
// 导入国际化配置
|
||
import "./i18n";
|
||
|
||
// 根据平台添加 body class,便于平台特定样式
|
||
try {
|
||
const ua = navigator.userAgent || "";
|
||
const plat = (navigator.platform || "").toLowerCase();
|
||
const isMac = /mac/i.test(ua) || plat.includes("mac");
|
||
if (isMac) {
|
||
document.body.classList.add("is-mac");
|
||
}
|
||
} catch {
|
||
// 忽略平台检测失败
|
||
}
|
||
|
||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||
<React.StrictMode>
|
||
<UpdateProvider>
|
||
<App />
|
||
</UpdateProvider>
|
||
</React.StrictMode>,
|
||
);
|