Chore: rename callback

This commit is contained in:
Matias Chomicki 2022-09-20 17:10:38 +02:00
parent 0b64ced209
commit 39f81f77b2

View File

@ -87,7 +87,7 @@ const MonacoQueryField = ({ languageProvider, history, onBlur, onRunQuery, initi
const onRunQueryRef = useLatest(onRunQuery); const onRunQueryRef = useLatest(onRunQuery);
const onBlurRef = useLatest(onBlur); const onBlurRef = useLatest(onBlur);
const autocompleteDisposeFun = useRef<(() => void) | null>(null); const autocompleteCleanupCallback = useRef<(() => void) | null>(null);
const theme = useTheme2(); const theme = useTheme2();
const styles = getStyles(theme); const styles = getStyles(theme);
@ -95,7 +95,7 @@ const MonacoQueryField = ({ languageProvider, history, onBlur, onRunQuery, initi
useEffect(() => { useEffect(() => {
// when we unmount, we unregister the autocomplete-function, if it was registered // when we unmount, we unregister the autocomplete-function, if it was registered
return () => { return () => {
autocompleteDisposeFun.current?.(); autocompleteCleanupCallback.current?.();
}; };
}, []); }, []);
@ -144,7 +144,7 @@ const MonacoQueryField = ({ languageProvider, history, onBlur, onRunQuery, initi
const { dispose } = monaco.languages.registerCompletionItemProvider(LANG_ID, filteringCompletionProvider); const { dispose } = monaco.languages.registerCompletionItemProvider(LANG_ID, filteringCompletionProvider);
autocompleteDisposeFun.current = dispose; autocompleteCleanupCallback.current = dispose;
// this code makes the editor resize itself so that the content fits // this code makes the editor resize itself so that the content fits
// (it will grow taller when necessary) // (it will grow taller when necessary)
// FIXME: maybe move this functionality into CodeEditor, like: // FIXME: maybe move this functionality into CodeEditor, like: