diff --git a/client/src/features/info/Info.jsx b/client/src/features/info/Info.jsx index 4f0f51e18..fc04fdcbe 100644 --- a/client/src/features/info/Info.jsx +++ b/client/src/features/info/Info.jsx @@ -1,10 +1,9 @@ -import { useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { useSocket } from 'app/context/socketContext'; import style from './Info.module.css'; import InfoTitle from './InfoTitle'; import InfoLogger from './InfoLogger'; import InfoNif from './InfoNif'; -import { useState } from 'react'; export default function Info() { const socket = useSocket(); diff --git a/client/src/features/info/InfoNif.jsx b/client/src/features/info/InfoNif.jsx index 4935733ea..d86f9c138 100644 --- a/client/src/features/info/InfoNif.jsx +++ b/client/src/features/info/InfoNif.jsx @@ -11,8 +11,7 @@ export default function InfoNif() { placeholderData: ontimePlaceholderInfo, }); const [collapsed, setCollapsed] = useState(false); - - const baseURL = `http://__IP__:${4001}`; + const baseURL = 'http://__IP__:4001'; const handleLink = (url) => { if (window.process?.type === 'renderer') { diff --git a/client/src/features/modals/EventSettingsModal.jsx b/client/src/features/modals/EventSettingsModal.jsx index 931cb2127..58238f042 100644 --- a/client/src/features/modals/EventSettingsModal.jsx +++ b/client/src/features/modals/EventSettingsModal.jsx @@ -13,7 +13,7 @@ import { EVENT_TABLE } from 'app/api/apiConstants'; import style from './Modals.module.css'; export default function SettingsModal() { - const { data, status, isError } = useFetch(EVENT_TABLE, fetchEvent); + const { data, status } = useFetch(EVENT_TABLE, fetchEvent); const [formData, setFormData] = useState({ title: '', url: '', @@ -36,13 +36,11 @@ export default function SettingsModal() { }); }, [data]); - console.log(`formData.endMessage`, formData.endMessage); - const submitHandler = async (event) => { event.preventDefault(); setSubmitting(true); - await postEvent(formData).then(setSubmitting(false)); + await postEvent(formData); setChanged(false); setSubmitting(false); @@ -71,7 +69,6 @@ export default function SettingsModal() { value={formData.title} onChange={(event) => { setChanged(true); - setFormData({ ...formData, title: event.target.value }); }} isDisabled={submitting} diff --git a/client/src/features/modals/ModalManager.jsx b/client/src/features/modals/ModalManager.jsx index 26322e2e7..d371991fa 100644 --- a/client/src/features/modals/ModalManager.jsx +++ b/client/src/features/modals/ModalManager.jsx @@ -50,5 +50,5 @@ export default function ModalManager(props) { ModalManager.propTypes = { isOpen: PropTypes.bool.isRequired, - onClose: PropTypes.bool.isRequired, + onClose: PropTypes.func.isRequired, }; diff --git a/client/src/features/modals/Modals.module.css b/client/src/features/modals/Modals.module.css index 8de4229fe..9949ab53f 100644 --- a/client/src/features/modals/Modals.module.css +++ b/client/src/features/modals/Modals.module.css @@ -6,6 +6,10 @@ margin-top: 0.5em; } +.modalBody > button { + margin-top: 1em; +} + .notes { font-weight: 400; color: #2b6cb0; @@ -26,8 +30,7 @@ span.notes { .modalInline { display: flex; - justify-content: space-between; - gap: 1em; + gap: 2em; } .highNotes { diff --git a/server/src/app.js b/server/src/app.js index 91fe8c18f..a6249e662 100644 --- a/server/src/app.js +++ b/server/src/app.js @@ -145,7 +145,13 @@ const server = http.createServer(app); export const startServer = async (overrideConfig = null) => { // Setup default port - const port = overrideConfig?.port || serverPort; + // const port = overrideConfig?.port || serverPort; + + /* Note: Port is hardcoded + * need to find a good solution for sharing + * the dynamic info with the frontend + */ + const port = 4001; // Start server const returnMessage = `HTTP Server is listening on port ${port}`; @@ -165,9 +171,12 @@ export const shutdown = async () => { // shutdown express server server.close(); + // shutdown OSC Server shutdownOSCServer(); + // shutdown OSC Client + oscClient.close(); // shutdown timer global.timer.shutdown();