fixing up some mobiles

This commit is contained in:
Shoofle 2024-11-01 13:44:24 -04:00
parent 0b82c15afe
commit 9575d333ad
2 changed files with 7 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import { Fab } from '@mui/material';
import './CommandEntry.css'; import './CommandEntry.css';
const CommandEntry = forwardRef(({ setCommand, onSubmitCommand, command }, ref) => { const CommandEntry = forwardRef(({ setCommand, onSubmitCommand, command }, ref) => {
return ( return (
<div className="commandline" > <div className="commandline" >
<input <input
@ -14,7 +13,7 @@ const CommandEntry = forwardRef(({ setCommand, onSubmitCommand, command }, ref)
type="text" type="text"
placeholder="Enter a command!" placeholder="Enter a command!"
value={command} /> value={command} />
<Fab onClick={ () => onSubmitCommand(command) } > <Fab onClick={ () => { console.log("clicked"); onSubmitCommand(command); }} >
Send Send
</Fab> </Fab>
</div> </div>

View File

@ -72,6 +72,7 @@ function Live({...props}) {
setAttributes(fetchAttributesQuery.data); setAttributes(fetchAttributesQuery.data);
}, [fetchAttributesQuery.data]); }, [fetchAttributesQuery.data]);
console.log("is live reloading wrking");
// verbs available to us // verbs available to us
const fetchVerbsQuery = useQuery({ const fetchVerbsQuery = useQuery({
queryKey: ['my verbs'], queryKey: ['my verbs'],
@ -80,12 +81,12 @@ function Live({...props}) {
let verbs = fetchVerbsQuery.data || []; let verbs = fetchVerbsQuery.data || [];
if (!editing) verbs = ["edit this"].concat(verbs); 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 const postMutation = useMutation({ // for changing the value when we're done with it
mutationFn: postPage, mutationFn: postPage,
onSettled: async (data, error, variables) => { 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() { function handleSubmitCommand() {
const c = command.trim(); const c = command.trim().toLowerCase();
console.log(c);
if (c == "edit this") setEditing(true); if (c == "edit this") setEditing(true);
else if (c == "save changes") { else if (c == "save changes") {
saveChanges(); saveChanges();