mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 02:16:39 +02:00
switch to server on password update
This commit is contained in:
@@ -44,7 +44,7 @@ const ModifiedFieldIndicator = () => {
|
|||||||
|
|
||||||
export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditServerFormProps) => {
|
export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditServerFormProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { updateServer } = useAuthStoreActions();
|
const { setCurrentServer, updateServer } = useAuthStoreActions();
|
||||||
const focusTrapRef = useFocusTrap();
|
const focusTrapRef = useFocusTrap();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
@@ -162,6 +162,16 @@ export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditSer
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateServer(server.id, serverItem);
|
updateServer(server.id, serverItem);
|
||||||
|
|
||||||
|
// After re-authenticating, switch to the updated server so the user
|
||||||
|
// isn't left on the credentials / server-required screen.
|
||||||
|
if (!canSkipAuth) {
|
||||||
|
const updated = getServerById(server.id);
|
||||||
|
if (updated) {
|
||||||
|
setCurrentServer(updated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
toast.success({
|
toast.success({
|
||||||
message: t('form.updateServer.title'),
|
message: t('form.updateServer.title'),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user