🧸 Zustand-ified AirDCPP Form

This commit is contained in:
2023-11-07 11:06:02 -06:00
parent 5b27658dc3
commit 07724380f7
3 changed files with 26 additions and 17 deletions

View File

@@ -7,6 +7,7 @@ export const useStore = create((set, get) => ({
airDCPPSocketConnected: false,
disconnectionInfo: {},
airDCPPClientConfiguration: {},
socketConnectionInformation: {},
setAirDCPPSocketConnectionStatus: () =>
set((value) => ({
airDCPPSocketConnected: value,
@@ -45,6 +46,9 @@ const initializeAirDCPPSocket = async (configuration) => {
};
// Attempt connection
const socketConnectionInformation = await initializedAirDCPPSocket.connect();
setState({
socketConnectionInformation,
});
};
// 1. get settings from mongo