chore: apply prettier formatting to component files

This commit is contained in:
Jason
2025-10-24 13:02:35 +08:00
parent 36767045ce
commit d296471b3b
16 changed files with 89 additions and 86 deletions
+4 -11
View File
@@ -74,9 +74,7 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
);
} catch (error) {
console.error("[AboutSection] Failed to open release notes", error);
toast.error(
t("settings.openReleaseNotesFailed"),
);
toast.error(t("settings.openReleaseNotesFailed"));
}
}, [t, updateInfo?.availableVersion, version]);
@@ -98,9 +96,7 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
await relaunchApp();
} catch (error) {
console.error("[AboutSection] Update failed", error);
toast.error(
t("settings.updateFailed"),
);
toast.error(t("settings.updateFailed"));
try {
await settingsApi.checkUpdates();
} catch (fallbackError) {
@@ -122,14 +118,11 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
}
} catch (error) {
console.error("[AboutSection] Check update failed", error);
toast.error(
t("settings.checkUpdateFailed"),
);
toast.error(t("settings.checkUpdateFailed"));
}
}, [checkUpdate, hasUpdate, isPortable, resetDismiss, t, updateHandle]);
const displayVersion =
version ?? t("common.unknown");
const displayVersion = version ?? t("common.unknown");
return (
<section className="space-y-4">
@@ -142,9 +142,7 @@ function ImportStatusMessage({
<Loader2 className="mt-0.5 h-4 w-4 animate-spin text-muted-foreground" />
<div>
<p className="font-medium">{t("settings.importing")}</p>
<p className="text-muted-foreground">
{t("common.loading")}
</p>
<p className="text-muted-foreground">{t("common.loading")}</p>
</div>
</div>
);
@@ -169,17 +167,13 @@ function ImportStatusMessage({
);
}
const message =
errorMessage ||
t("settings.importFailed");
const message = errorMessage || t("settings.importFailed");
return (
<div className={`${baseClass} border-red-200 bg-red-100/70 text-red-600`}>
<AlertCircle className="mt-0.5 h-4 w-4" />
<div className="space-y-1">
<p className="font-medium">
{t("settings.importFailed")}
</p>
<p className="font-medium">{t("settings.importFailed")}</p>
<p>{message}</p>
</div>
</div>
+2 -6
View File
@@ -142,9 +142,7 @@ export function SettingsDialog({
const handleRestartNow = useCallback(async () => {
setShowRestartPrompt(false);
if (import.meta.env.DEV) {
toast.success(
t("settings.devModeRestartHint"),
);
toast.success(t("settings.devModeRestartHint"));
closeAfterSave();
return;
}
@@ -153,9 +151,7 @@ export function SettingsDialog({
await settingsApi.restart();
} catch (error) {
console.error("[SettingsDialog] Failed to restart app", error);
toast.error(
t("settings.restartFailed"),
);
toast.error(t("settings.restartFailed"));
} finally {
closeAfterSave();
}