1
0
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:
Bogdan 2024-12-23 10:33:08 +02:00 committed by Mark McDowall
parent 4b14368736
commit 514c04935f
2 changed files with 9 additions and 3 deletions

View File

@ -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>

View File

@ -95,7 +95,6 @@ function Metadata({ id, name, enable, fields }: MetadataProps) {
) : null}
<EditMetadataModal
advancedSettings={false}
id={id}
isOpen={isEditMetadataModalOpen}
onModalClose={handleModalClose}