From 7e826dedc6e49dda365f42f5abb3ea2f5eecbf75 Mon Sep 17 00:00:00 2001 From: MontejoJorge Date: Thu, 1 May 2025 12:03:00 +0200 Subject: [PATCH] Revert "use SimpleAlert component" This reverts commit ac28346aceb3797570e036d03e6b21739073e763. --- .../routes/session/forgotPassword/index.tsx | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/apps/stable/routes/session/forgotPassword/index.tsx b/src/apps/stable/routes/session/forgotPassword/index.tsx index 832c388a8..d0da1defc 100644 --- a/src/apps/stable/routes/session/forgotPassword/index.tsx +++ b/src/apps/stable/routes/session/forgotPassword/index.tsx @@ -5,17 +5,14 @@ import globalize from 'lib/globalize'; import Button from 'elements/emby-button/Button'; import Input from 'elements/emby-input/Input'; import { useMutation } from '@tanstack/react-query'; +import Dashboard from 'utils/dashboard'; import { getUserApi } from '@jellyfin/sdk/lib/utils/api/user-api'; import { ForgotPasswordAction } from '@jellyfin/sdk/lib/generated-client/models/forgot-password-action'; import ServerConnections from 'components/ServerConnections'; -import SimpleAlert from 'components/SimpleAlert'; export const ForgotPasswordPage = () => { const navigate = useNavigate(); const [username, setUsername] = useState(''); - const [isAlertOpen, setIsAlertOpen] = useState(false); - const [alertMessage, setAlertMessage] = useState(''); - const [alertCallback, setAlertCallback] = useState<(() => void) | undefined>(undefined); const forgotPasswordMutation = useMutation({ mutationFn: async (enteredUsername: string) => { @@ -44,17 +41,22 @@ export const ForgotPasswordPage = () => { break; case ForgotPasswordAction.PinCode: msg = globalize.translate('MessageForgotPasswordFileCreated'); - msg += ': '; + msg += '

'; + msg += globalize.translate('MessageForgotPasswordPinReset'); + msg += '

'; msg += result.PinFile; + msg += '
'; callback = () => navigate('/forgotpasswordpin'); break; default: return; } - setAlertMessage(msg); - setAlertCallback(() => callback); - setIsAlertOpen(true); + Dashboard.alert({ + message: msg, + title: globalize.translate('ButtonForgotPassword'), + callback: callback + }); } }); @@ -71,23 +73,11 @@ export const ForgotPasswordPage = () => { setUsername(e.target.value); }, []); - const handleAlertClose = useCallback(() => { - setIsAlertOpen(false); - if (alertCallback) { - alertCallback(); - } - }, [alertCallback]); - return ( -