fix reliability/maintainability issues raised by sonarqube

fixed issues:
- typescript:S7781
- typescript:S6759
This commit is contained in:
Rye committed 2026-03-14 16:41:44 +01:00
1 parent 1c5314dd55
commit 7c4decd4e9
1 file changed
+3 -3
@@ -70,7 +70,7 @@ function makeUIAAction<T>(
type SetupVerificationProps = {
onComplete: (recoveryKey: string) => void;
};
function SetupVerification({ onComplete }: SetupVerificationProps) {
function SetupVerification({ onComplete }: Readonly<SetupVerificationProps>) {
const mx = useMatrixClient();
const alive = useAlive();
@@ -227,7 +227,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
type RecoveryKeyDisplayProps = {
recoveryKey: string;
};
function RecoveryKeyDisplay({ recoveryKey }: RecoveryKeyDisplayProps) {
function RecoveryKeyDisplay({ recoveryKey }: Readonly<RecoveryKeyDisplayProps>) {
const [show, setShow] = useState(false);
const handleCopy = () => {
@@ -241,7 +241,7 @@ function RecoveryKeyDisplay({ recoveryKey }: RecoveryKeyDisplayProps) {
FileSaver.saveAs(blob, 'recovery-key.txt');
};
const safeToDisplayKey = show ? recoveryKey : recoveryKey.replace(/[^\s]/g, '*');
const safeToDisplayKey = show ? recoveryKey : recoveryKey.replaceAll(/[^\s]/g, '*');
return (
<Box direction="Column" gap="400">