chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
- i18next 23->26 + react-i18next 15->17 - prettier 2->3, reformat all files - replace @fontsource/inter with @fontsource-variable/inter 5, update import path - domhandler 5->6 (aligns with transitive deps) - lint-staged 16->17
This commit is contained in:
@@ -86,7 +86,7 @@ export function AuthLayout() {
|
||||
serverName,
|
||||
response,
|
||||
};
|
||||
}, [])
|
||||
}, []),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -100,7 +100,7 @@ export function AuthLayout() {
|
||||
generatePath(currentAuthPath(location.pathname), {
|
||||
server: encodeURIComponent(server),
|
||||
}),
|
||||
{ replace: true }
|
||||
{ replace: true },
|
||||
);
|
||||
}
|
||||
}, [urlEncodedServer, navigate, location, server]);
|
||||
@@ -113,10 +113,10 @@ export function AuthLayout() {
|
||||
return;
|
||||
}
|
||||
navigate(
|
||||
generatePath(currentAuthPath(location.pathname), { server: encodeURIComponent(newServer) })
|
||||
generatePath(currentAuthPath(location.pathname), { server: encodeURIComponent(newServer) }),
|
||||
);
|
||||
},
|
||||
[navigate, location, discoveryState, server, discoverServer]
|
||||
[navigate, location, discoveryState, server, discoverServer],
|
||||
);
|
||||
|
||||
const [autoDiscoveryError, autoDiscoveryInfo] =
|
||||
|
||||
@@ -19,7 +19,7 @@ export function SSOLogin({ providers, redirectUrl, action, saveScreenSpace }: SS
|
||||
|
||||
const withoutIcon = providers
|
||||
? providers.find(
|
||||
(provider) => !provider.icon || !mx.mxcUrlToHttp(provider.icon, 96, 96, 'crop', false)
|
||||
(provider) => !provider.icon || !mx.mxcUrlToHttp(provider.icon, 96, 96, 'crop', false),
|
||||
)
|
||||
: true;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ const useLoginSearchParams = (searchParams: URLSearchParams): LoginPathSearchPar
|
||||
email: searchParams.get('email') ?? undefined,
|
||||
loginToken: searchParams.get('loginToken') ?? undefined,
|
||||
}),
|
||||
[searchParams]
|
||||
[searchParams],
|
||||
);
|
||||
|
||||
export function Login() {
|
||||
@@ -48,7 +48,7 @@ export function Login() {
|
||||
window.location.replace(
|
||||
withSearchParam(absoluteLoginPath, {
|
||||
loginToken: loginTokenForHashRouter,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ export type CustomLoginResponse = {
|
||||
};
|
||||
export const login = async (
|
||||
serverBaseUrl: string | (() => Promise<string>),
|
||||
data: LoginRequest
|
||||
data: LoginRequest,
|
||||
): Promise<CustomLoginResponse> => {
|
||||
const [urlError, url] =
|
||||
typeof serverBaseUrl === 'function' ? await to(serverBaseUrl()) : [undefined, serverBaseUrl];
|
||||
|
||||
@@ -112,7 +112,7 @@ function RegisterUIAFlow({
|
||||
initial_device_display_name: 'Lotus Chat Web',
|
||||
});
|
||||
},
|
||||
[onRegister, formData]
|
||||
[onRegister, formData],
|
||||
);
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
|
||||
@@ -20,7 +20,7 @@ const useRegisterSearchParams = (searchParams: URLSearchParams): RegisterPathSea
|
||||
email: searchParams.get('email') ?? undefined,
|
||||
token: searchParams.get('token') ?? undefined,
|
||||
}),
|
||||
[searchParams]
|
||||
[searchParams],
|
||||
);
|
||||
|
||||
export function Register() {
|
||||
|
||||
@@ -37,7 +37,7 @@ export type CustomRegisterResponse = {
|
||||
export type RegisterResult = [IAuthData, undefined] | [undefined, CustomRegisterResponse];
|
||||
export const register = async (
|
||||
mx: MatrixClient,
|
||||
requestData: RegisterRequest
|
||||
requestData: RegisterRequest,
|
||||
): Promise<RegisterResult> => {
|
||||
const [err, res] = await to<RegisterResponse, MatrixError>(mx.registerRequest(requestData));
|
||||
|
||||
@@ -130,7 +130,7 @@ export const useRegisterComplete = (data?: CustomRegisterResponse) => {
|
||||
withSearchParam<LoginPathSearchParams>(getLoginPath(userServer), {
|
||||
username,
|
||||
}),
|
||||
{ replace: true }
|
||||
{ replace: true },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ export function PasswordResetForm({ defaultEmail }: PasswordResetFormProps) {
|
||||
},
|
||||
password: formData.password,
|
||||
},
|
||||
formData.password
|
||||
formData.password,
|
||||
);
|
||||
}
|
||||
}, [ongoingAuthData, flowErrorCode, formData, handleResetPassword]);
|
||||
@@ -161,7 +161,7 @@ export function PasswordResetForm({ defaultEmail }: PasswordResetFormProps) {
|
||||
const { password } = formData;
|
||||
handleResetPassword(authDict, password);
|
||||
},
|
||||
[formData, handleResetPassword]
|
||||
[formData, handleResetPassword],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,13 +7,13 @@ import { PasswordResetForm } from './PasswordResetForm';
|
||||
import { ResetPasswordPathSearchParams } from '../../paths';
|
||||
|
||||
const useResetPasswordSearchParams = (
|
||||
searchParams: URLSearchParams
|
||||
searchParams: URLSearchParams,
|
||||
): ResetPasswordPathSearchParams =>
|
||||
useMemo(
|
||||
() => ({
|
||||
email: searchParams.get('email') ?? undefined,
|
||||
}),
|
||||
[searchParams]
|
||||
[searchParams],
|
||||
);
|
||||
|
||||
export function ResetPassword() {
|
||||
|
||||
@@ -6,10 +6,10 @@ export type ResetPasswordResult = [IAuthData, undefined] | [undefined, ResetPass
|
||||
export const resetPassword = async (
|
||||
mx: MatrixClient,
|
||||
authDict: AuthDict,
|
||||
newPassword: string
|
||||
newPassword: string,
|
||||
): Promise<ResetPasswordResult> => {
|
||||
const [err, res] = await to<ResetPasswordResponse, MatrixError>(
|
||||
mx.setPassword(authDict, newPassword, false)
|
||||
mx.setPassword(authDict, newPassword, false),
|
||||
);
|
||||
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user