mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-11 17:16:50 -05:00
Compare commits
3 Commits
renovate/s
...
fallenbage
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
098155baa4 | ||
|
|
e0a81038cd | ||
|
|
4ab919360a |
@@ -3,6 +3,7 @@ import Button from '@app/components/Common/Button';
|
|||||||
import { SmallLoadingSpinner } from '@app/components/Common/LoadingSpinner';
|
import { SmallLoadingSpinner } from '@app/components/Common/LoadingSpinner';
|
||||||
import usePlexLogin from '@app/hooks/usePlexLogin';
|
import usePlexLogin from '@app/hooks/usePlexLogin';
|
||||||
import defineMessages from '@app/utils/defineMessages';
|
import defineMessages from '@app/utils/defineMessages';
|
||||||
|
import { Fragment } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
const messages = defineMessages('components.Login', {
|
const messages = defineMessages('components.Login', {
|
||||||
@@ -46,8 +47,12 @@ const PlexLoginButton = ({
|
|||||||
>
|
>
|
||||||
{(chunks) => (
|
{(chunks) => (
|
||||||
<>
|
<>
|
||||||
{chunks.map((c) =>
|
{chunks.map((c, index) =>
|
||||||
typeof c === 'string' ? <span>{c}</span> : c
|
typeof c === 'string' ? (
|
||||||
|
<span key={index}>{c}</span>
|
||||||
|
) : (
|
||||||
|
<Fragment key={index}>{c}</Fragment>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -377,6 +377,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => {
|
|||||||
webAppUrl: data?.webAppUrl,
|
webAppUrl: data?.webAppUrl,
|
||||||
}}
|
}}
|
||||||
validationSchema={PlexSettingsSchema}
|
validationSchema={PlexSettingsSchema}
|
||||||
|
validateOnMount={true}
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
let toastId: string | null = null;
|
let toastId: string | null = null;
|
||||||
try {
|
try {
|
||||||
@@ -423,6 +424,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => {
|
|||||||
values,
|
values,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
setFieldValue,
|
setFieldValue,
|
||||||
|
setValues,
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
isValid,
|
isValid,
|
||||||
}) => {
|
}) => {
|
||||||
@@ -445,9 +447,12 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => {
|
|||||||
availablePresets[Number(e.target.value)];
|
availablePresets[Number(e.target.value)];
|
||||||
|
|
||||||
if (targPreset) {
|
if (targPreset) {
|
||||||
setFieldValue('hostname', targPreset.address);
|
setValues({
|
||||||
setFieldValue('port', targPreset.port);
|
...values,
|
||||||
setFieldValue('useSsl', targPreset.ssl);
|
hostname: targPreset.address,
|
||||||
|
port: targPreset.port,
|
||||||
|
useSsl: targPreset.ssl,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ const LoginWithPlex = ({ onComplete }: LoginWithPlexProps) => {
|
|||||||
const response = await axios.post('/api/v1/auth/plex', { authToken });
|
const response = await axios.post('/api/v1/auth/plex', { authToken });
|
||||||
|
|
||||||
if (response.data?.id) {
|
if (response.data?.id) {
|
||||||
revalidate();
|
const { data: user } = await axios.get('/api/v1/auth/me');
|
||||||
|
revalidate(user, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (authToken) {
|
if (authToken) {
|
||||||
|
|||||||
Reference in New Issue
Block a user