diff --git a/packages/desktop-client/src/components/FatalError.tsx b/packages/desktop-client/src/components/FatalError.tsx index 1d8a7a70b20..20a846c622c 100644 --- a/packages/desktop-client/src/components/FatalError.tsx +++ b/packages/desktop-client/src/components/FatalError.tsx @@ -165,7 +165,9 @@ function FatalError({ buttonText, error }: FatalErrorProps) { > {showSimpleRender ? : } - + setShowError(true)}>Show Error diff --git a/packages/desktop-client/src/components/Notifications.tsx b/packages/desktop-client/src/components/Notifications.tsx index 368d095563c..76962a9c013 100644 --- a/packages/desktop-client/src/components/Notifications.tsx +++ b/packages/desktop-client/src/components/Notifications.tsx @@ -48,7 +48,7 @@ function compileMessage( if (actions[actionName]) { setLoading(true); await actions[actionName](); - onRemove(); + onRemove?.(); } }} > diff --git a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx index 80d49ef1069..0ca0cb9c81b 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx @@ -17,11 +17,11 @@ import { ConfirmPasswordForm } from './ConfirmPasswordForm'; export default function Bootstrap() { let dispatch = useDispatch(); - let [error, setError] = useState(null); + let [error, setError] = useState(null); let { checked } = useBootstrapped(); - function getErrorMessage(error) { + function getErrorMessage(error: string) { switch (error) { case 'invalid-password': return 'Password cannot be empty'; @@ -34,7 +34,7 @@ export default function Bootstrap() { } } - async function onSetPassword(password) { + async function onSetPassword(password: string) { setError(null); let { error } = await send('subscribe-bootstrap', { password }); @@ -94,7 +94,7 @@ export default function Bootstrap() { } onSetPassword={onSetPassword} - onError={setError} + onError={err => setError(err)} /> ); diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx index bf0f97bcf3c..d82f1e1a68e 100644 --- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx @@ -13,10 +13,10 @@ import { ConfirmPasswordForm } from './ConfirmPasswordForm'; export default function ChangePassword() { let navigate = useNavigate(); - let [error, setError] = useState(null); - let [msg, setMessage] = useState(null); + let [error, setError] = useState(null); + let [msg, setMessage] = useState(null); - function getErrorMessage(error) { + function getErrorMessage(error: string) { switch (error) { case 'invalid-password': return 'Password cannot be empty'; @@ -29,7 +29,7 @@ export default function ChangePassword() { } } - async function onSetPassword(password) { + async function onSetPassword(password: string) { setError(null); let { error } = await send('subscribe-change-password', { password }); @@ -93,7 +93,7 @@ export default function ChangePassword() { } onSetPassword={onSetPassword} - onError={setError} + onError={err => setError(err)} /> ); diff --git a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx index b0d5b3622ff..89da11698b9 100644 --- a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.tsx @@ -1,10 +1,20 @@ -import React, { type ChangeEvent, useState } from 'react'; +import React, { type ChangeEvent, type ReactNode, useState } from 'react'; import { ButtonWithLoading } from '../../common/Button'; import { BigInput } from '../../common/Input'; import View from '../../common/View'; -export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) { +type ConfirmPasswordFormProps = { + buttons: ReactNode; + onSetPassword: (password: string) => void; + onError: (error: string) => void; +}; + +export function ConfirmPasswordForm({ + buttons, + onSetPassword, + onError, +}: ConfirmPasswordFormProps) { let [password1, setPassword1] = useState(''); let [password2, setPassword2] = useState(''); let [showPassword, setShowPassword] = useState(false); diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.tsx b/packages/desktop-client/src/components/schedules/SchedulesTable.tsx index e6b625c2dd7..b55bd3df22b 100644 --- a/packages/desktop-client/src/components/schedules/SchedulesTable.tsx +++ b/packages/desktop-client/src/components/schedules/SchedulesTable.tsx @@ -106,7 +106,7 @@ export function ScheduleAmountCell({ amount, op }) { 0 ? colors.g5 : null, + color: num > 0 ? colors.g5 : undefined, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',