fix: highlighting error

This commit is contained in:
Felix Roos 2022-11-13 18:44:00 +01:00
parent 7ab263b514
commit 2341452d91
2 changed files with 13 additions and 9 deletions

View file

@ -173,10 +173,17 @@ function App() {
// UI Actions
//
const handleChangeCode = (c) => {
setCode(c);
started && logger('[edit] code changed. hit ctrl+enter to update');
};
const handleChangeCode = useCallback(
(c) => {
setCode(c);
started && logger('[edit] code changed. hit ctrl+enter to update');
},
[started],
);
const handleSelectionChange = useCallback((selection) => {
// TODO: scroll to selected function in reference
// console.log('selectino change', selection.ranges[0].from);
}, []);
const handleTogglePlay = async () => {
await getAudioContext().resume(); // fixes no sound in ios webkit
if (!started) {
@ -259,10 +266,7 @@ function App() {
value={code}
onChange={handleChangeCode}
onViewChanged={setView}
onSelectionChange={(selection) => {
// TODO: scroll to selected function in reference
// console.log('selectino change', selection.ranges[0].from);
}}
onSelectionChange={handleSelectionChange}
/>
</section>
{error && (