mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-02 06:31:51 +02:00
Fixed: Advanced settings for Metadata consumers
This commit is contained in:
parent
4b14368736
commit
514c04935f
@ -1,5 +1,6 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import AppState from 'App/State/AppState';
|
||||
import Modal from 'Components/Modal/Modal';
|
||||
import { sizes } from 'Helpers/Props';
|
||||
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
||||
@ -7,7 +8,8 @@ import EditMetadataModalContent, {
|
||||
EditMetadataModalContentProps,
|
||||
} from './EditMetadataModalContent';
|
||||
|
||||
interface EditMetadataModalProps extends EditMetadataModalContentProps {
|
||||
interface EditMetadataModalProps
|
||||
extends Omit<EditMetadataModalContentProps, 'advancedSettings'> {
|
||||
isOpen: boolean;
|
||||
}
|
||||
|
||||
@ -18,6 +20,10 @@ function EditMetadataModal({
|
||||
}: EditMetadataModalProps) {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const advancedSettings = useSelector(
|
||||
(state: AppState) => state.settings.advancedSettings
|
||||
);
|
||||
|
||||
const handleModalClose = useCallback(() => {
|
||||
dispatch(clearPendingChanges({ section: 'metadata' }));
|
||||
onModalClose();
|
||||
@ -27,6 +33,7 @@ function EditMetadataModal({
|
||||
<Modal size={sizes.MEDIUM} isOpen={isOpen} onModalClose={handleModalClose}>
|
||||
<EditMetadataModalContent
|
||||
{...otherProps}
|
||||
advancedSettings={advancedSettings}
|
||||
onModalClose={handleModalClose}
|
||||
/>
|
||||
</Modal>
|
||||
|
@ -95,7 +95,6 @@ function Metadata({ id, name, enable, fields }: MetadataProps) {
|
||||
) : null}
|
||||
|
||||
<EditMetadataModal
|
||||
advancedSettings={false}
|
||||
id={id}
|
||||
isOpen={isEditMetadataModalOpen}
|
||||
onModalClose={handleModalClose}
|
||||
|
Loading…
Reference in New Issue
Block a user