chore: disable admin mode autolaunch limitation

This commit is contained in:
wonfen
2025-04-19 12:37:01 +08:00
parent 2b1d02f0cc
commit c718ef3058
4 changed files with 10 additions and 13 deletions

View File

@@ -194,7 +194,7 @@ const SettingSystem = ({ onError }: Props) => {
label={t("Auto Launch")}
extra={
isAdminMode && (
<Tooltip title={t("Administrator mode does not support auto launch")}>
<Tooltip title={t("Administrator mode may not support auto launch")}>
<WarningRounded sx={{ color: "warning.main", mr: 1 }} />
</Tooltip>
)
@@ -206,14 +206,12 @@ const SettingSystem = ({ onError }: Props) => {
onCatch={onError}
onFormat={onSwitchFormat}
onChange={(e) => {
// 管理员模式下禁用更改
if (isAdminMode) return;
// 移除管理员模式检查提示
onChangeData({ enable_auto_launch: e });
}}
onGuard={async (e) => {
if (isAdminMode) {
Notice.error(t("Administrator mode does not support auto launch"), 2000);
return Promise.reject(new Error(t("Administrator mode does not support auto launch")));
Notice.info(t("Administrator mode may not support auto launch"), 2000);
}
try {
@@ -230,7 +228,7 @@ const SettingSystem = ({ onError }: Props) => {
}
}}
>
<Switch edge="end" disabled={isAdminMode} />
<Switch edge="end" />
</GuardState>
</SettingItem>