🔧 Fixing the AirDCPP socket issue on AcquisitionPanel on ComicDetails page

This commit is contained in:
2022-06-21 12:43:35 -07:00
parent 34e475d3cc
commit 702f4e62a2
3 changed files with 41 additions and 25 deletions

View File

@@ -10,12 +10,14 @@ export const AirDCPPHubsForm = (airDCPPClientUserSettings): ReactElement => {
const dispatch = useDispatch();
const [hubList, setHubList] = useState([]);
const airDCPPConfiguration = useContext(AirDCPPSocketContext);
const { AirDCPPSocket, settings } = airDCPPConfiguration;
const {
airDCPPState: { settings, socket },
} = airDCPPConfiguration;
useEffect(() => {
(async () => {
if (!isEmpty(settings)) {
const hubs = await AirDCPPSocket.get(`hubs`);
const hubs = await socket.get(`hubs`);
const hubSelectionOptions = hubs.map(({ hub_url, identity }) => ({
value: hub_url,
label: identity.name,