Import queue progress (#87)
* 🚥 Added service status panel scaffold * 🐂 Support for showing import progress * 🐂 Support for session-tracking * 🔧 Tooling for resumable socket.io sessions * 🧹 Minor change in socket.io connection code * 🔧 Refactoring the Import Page * 📝 Added more details to import statuses * 🐂 Queue pause/resume functionality * 🐂 Queue drain event reducer * 🐂 Queue controls * 🔧 Hardening the import UX * 🔀 Bumped deps * 🔧 Fixed the airdcpp-apisocket version * ⛑️ Removed useless deps * 🪡 Fixed margin on the comicinfo.xml panel on the library page * 🏗️ Scaffold for job results * 🔢 Removed the useless LS_IMPORT event * 🔧 Wired up jobStatistics call * 🧹 Cleaning up the tabulated job results * 🔧 More finishing touches to Import UX * 🔧 Added a console log for debugging purposes --------- Co-authored-by: Rishi Ghan <hghan@apple.com>
This commit was merged in pull request #87.
This commit is contained in:
11
src/client/shared/middleware/SocketIOMiddleware.tsx
Normal file
11
src/client/shared/middleware/SocketIOMiddleware.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
const socketIOMiddleware = (socket) => {
|
||||
return (store) => (next) => (action) => {
|
||||
if (action.type === "EMIT_SOCKET_EVENT") {
|
||||
const { event, data } = action.payload;
|
||||
socket.emit(event, data);
|
||||
}
|
||||
return next(action);
|
||||
};
|
||||
};
|
||||
|
||||
export default socketIOMiddleware;
|
||||
10
src/client/shared/socket.io/instance.tsx
Normal file
10
src/client/shared/socket.io/instance.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import io from "socket.io-client";
|
||||
import { SOCKET_BASE_URI } from "../../constants/endpoints";
|
||||
const sessionId = localStorage.getItem("sessionId");
|
||||
const socketIOConnectionInstance = io(SOCKET_BASE_URI, {
|
||||
transports: ["websocket"],
|
||||
withCredentials: true,
|
||||
query: { sessionId },
|
||||
});
|
||||
|
||||
export default socketIOConnectionInstance;
|
||||
Reference in New Issue
Block a user