switch lang tag on language switch, lint

This commit is contained in:
Eduard Gert
2026-06-18 16:16:45 +02:00
parent 461ec1c8f5
commit 731e87be72
11 changed files with 94 additions and 60 deletions
@@ -71,11 +71,11 @@ export const ProfileCreationModal = ({ open, onOpenChange, onSubmit, initial }:
useEffect(() => {
if (!open) return;
initialModeRef.current = mode;
const id = window.setTimeout(() => {
const id = globalThis.setTimeout(() => {
nameRef.current?.focus();
nameRef.current?.select();
}, 0);
return () => window.clearTimeout(id);
return () => globalThis.clearTimeout(id);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open]);
@@ -108,7 +108,7 @@ export const ProfileCreationModal = ({ open, onOpenChange, onSubmit, initial }:
}
const target = normalizeManagementUrl(trimmed);
const unchanged = initial && target === initial.managementUrl;
const unchanged = target === initial?.managementUrl;
return { url: target, needsReachCheck: !unchanged };
};
@@ -504,11 +504,9 @@ const RowActions = ({
}: RowActionsProps) => {
const { t } = useTranslation();
const deleteDisabled = isDefault || isActive;
const deleteDisabledReason = isDefault
? t("profile.delete.disabledDefault")
: isActive
? t("profile.delete.disabledActive")
: null;
let deleteDisabledReason: string | null = null;
if (isDefault) deleteDisabledReason = t("profile.delete.disabledDefault");
else if (isActive) deleteDisabledReason = t("profile.delete.disabledActive");
return (
<div className={"inline-flex items-center gap-1"}>
<ActionIconButton