From 9575d333ad8431e24dfd453f1541d09edb660692 Mon Sep 17 00:00:00 2001 From: shoofle Date: Fri, 1 Nov 2024 13:44:24 -0400 Subject: [PATCH] fixing up some mobiles --- client/src/embodied/CommandEntry.jsx | 3 +-- client/src/embodied/Live.jsx | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/embodied/CommandEntry.jsx b/client/src/embodied/CommandEntry.jsx index ceaabb6b..d470a077 100644 --- a/client/src/embodied/CommandEntry.jsx +++ b/client/src/embodied/CommandEntry.jsx @@ -4,7 +4,6 @@ import { Fab } from '@mui/material'; import './CommandEntry.css'; const CommandEntry = forwardRef(({ setCommand, onSubmitCommand, command }, ref) => { - return (
- onSubmitCommand(command) } > + { console.log("clicked"); onSubmitCommand(command); }} > Send
diff --git a/client/src/embodied/Live.jsx b/client/src/embodied/Live.jsx index f8c60b53..eca0bd66 100644 --- a/client/src/embodied/Live.jsx +++ b/client/src/embodied/Live.jsx @@ -72,6 +72,7 @@ function Live({...props}) { setAttributes(fetchAttributesQuery.data); }, [fetchAttributesQuery.data]); + console.log("is live reloading wrking"); // verbs available to us const fetchVerbsQuery = useQuery({ queryKey: ['my verbs'], @@ -80,12 +81,12 @@ function Live({...props}) { let verbs = fetchVerbsQuery.data || []; if (!editing) verbs = ["edit this"].concat(verbs); - else verbs = ["save changes"].concat(verbs); + else verbs = ["save changes", "discard changes"].concat(verbs); const postMutation = useMutation({ // for changing the value when we're done with it mutationFn: postPage, onSettled: async (data, error, variables) => { - queryClient.invalidateQueries(['page', variables.number, null]) + await queryClient.invalidateQueries(['page', variables.number, null]) }, }); @@ -101,7 +102,9 @@ function Live({...props}) { } function handleSubmitCommand() { - const c = command.trim(); + const c = command.trim().toLowerCase(); + console.log(c); + if (c == "edit this") setEditing(true); else if (c == "save changes") { saveChanges();