🍼 Cleaned up the OPDS feed

This commit is contained in:
2021-09-23 18:11:20 -07:00
parent 99e25b6cbb
commit bbde67bb11
9 changed files with 158 additions and 74 deletions

View File

@@ -3,6 +3,7 @@ import io, { Socket } from "socket.io-client";
import { SOCKET_BASE_URI } from "../../constants/endpoints";
import { useDispatch } from "react-redux";
import { RMQ_SOCKET_CONNECTED } from "../../constants/action-types";
import { isNil } from "lodash";
const WebSocketContext = createContext(null);
export const WebSocketProvider = ({ children }) => {
@@ -10,7 +11,7 @@ export const WebSocketProvider = ({ children }) => {
let ws;
const dispatch = useDispatch();
if (!socket) {
if (!isNil(socket)) {
socket = io(SOCKET_BASE_URI);
socket.on("connect", () => {