mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-02 04:39:14 -05:00
feat(email validation): email requirement and validation + better importer
This commit is contained in:
@@ -5,7 +5,7 @@ import { useUser } from '../../hooks/useUser';
|
||||
import PlexLoginButton from '../PlexLoginButton';
|
||||
|
||||
const messages = defineMessages({
|
||||
welcome: 'Welcome to Overseerr',
|
||||
welcome: 'Welcome to Jellyseerr',
|
||||
signinMessage: 'Get started by signing in with your Plex account',
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { MediaServerType } from '../../../server/constants/server';
|
||||
import getConfig from 'next/config';
|
||||
|
||||
const messages = defineMessages({
|
||||
welcome: 'Welcome to Overseerr',
|
||||
welcome: 'Welcome to Jellyseerr',
|
||||
signinMessage: 'Get started by signing in',
|
||||
signinWithJellyfin: 'Use your {mediaServerName} account',
|
||||
signinWithPlex: 'Use your Plex account',
|
||||
|
||||
@@ -9,6 +9,7 @@ import globalMessages from '../../i18n/globalMessages';
|
||||
import Alert from '../Common/Alert';
|
||||
import Modal from '../Common/Modal';
|
||||
import getConfig from 'next/config';
|
||||
import { UserResultsResponse } from '../../../server/interfaces/api/userInterfaces';
|
||||
|
||||
interface JellyfinImportProps {
|
||||
onCancel?: () => void;
|
||||
@@ -30,6 +31,7 @@ const messages = defineMessages({
|
||||
const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
||||
onCancel,
|
||||
onComplete,
|
||||
children,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const settings = useSettings();
|
||||
@@ -117,6 +119,20 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const { data: existingUsers } = useSWR<UserResultsResponse>(
|
||||
`/api/v1/user?take=${children}`
|
||||
);
|
||||
|
||||
data?.forEach((user, pos) => {
|
||||
if (
|
||||
existingUsers?.results.some(
|
||||
(existingUser) => existingUser.jellyfinUserId === user.id
|
||||
)
|
||||
) {
|
||||
delete data[pos];
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal
|
||||
loading={!data && !error}
|
||||
|
||||
@@ -482,7 +482,9 @@ const UserList: React.FC = () => {
|
||||
setShowImportModal(false);
|
||||
revalidate();
|
||||
}}
|
||||
/>
|
||||
>
|
||||
{data.pageInfo.results}
|
||||
</JellyfinImportModal>
|
||||
)}
|
||||
</Transition>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user