🏗️ Refactoring AirDCPP Settings Form with react-query
This commit is contained in:
@@ -12,28 +12,26 @@ export const AirDCPPSettingsForm = (): ReactElement => {
|
|||||||
const airDCPPSettings = useContext(AirDCPPSocketContext);
|
const airDCPPSettings = useContext(AirDCPPSocketContext);
|
||||||
console.log(airDCPPSettings);
|
console.log(airDCPPSettings);
|
||||||
|
|
||||||
// const onSubmit = useCallback(async (values) => {
|
const onSubmit = useCallback(async (values) => {
|
||||||
// try {
|
try {
|
||||||
// airDCPPSettings.setSettings(values);
|
airDCPPSettings.setSettings(values);
|
||||||
// // dispatch(saveSettings(values, "directConnect"));
|
// dispatch(saveSettings(values, "directConnect"));
|
||||||
// } catch (error) {
|
} catch (error) {
|
||||||
// console.log(error);
|
console.log(error);
|
||||||
// }
|
}
|
||||||
// }, []);
|
}, []);
|
||||||
// const removeSettings = useCallback(async () => {
|
const removeSettings = useCallback(async () => {
|
||||||
// airDCPPSettings.setSettings({});
|
airDCPPSettings.setSettings({});
|
||||||
// // dispatch(deleteSettings());
|
// dispatch(deleteSettings());
|
||||||
// }, []);
|
}, []);
|
||||||
//
|
//
|
||||||
// const initFormData = !isUndefined(
|
const initFormData = !isUndefined(airDCPPSettings.airDCPPState.settings)
|
||||||
// airDCPPSettings.airDCPPState.settings.directConnect,
|
? airDCPPSettings.airDCPPState.settings
|
||||||
// )
|
: {};
|
||||||
// ? airDCPPSettings.airDCPPState.settings.directConnect.client.host
|
|
||||||
// : {};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <ConnectionForm
|
<ConnectionForm
|
||||||
initialData={initFormData}
|
initialData={initFormData}
|
||||||
submitHandler={onSubmit}
|
submitHandler={onSubmit}
|
||||||
formHeading={"Configure AirDC++"}
|
formHeading={"Configure AirDC++"}
|
||||||
@@ -51,7 +49,7 @@ export const AirDCPPSettingsForm = (): ReactElement => {
|
|||||||
Delete
|
Delete
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
) : null} */}
|
) : null}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user