style(tokenizer.js): comment out console.log statement

fix(Settings.jsx): handle null or empty context in useEffect to avoid errors
This commit is contained in:
Danny Avila 2023-04-04 10:07:48 -04:00
parent 1a196580b2
commit 6e233accf5
2 changed files with 3 additions and 5 deletions

View file

@ -28,14 +28,12 @@ function Settings(props) {
// useEffect to update token count
useEffect(() => {
if (!context) return;
if (context.trim() === '') {
if (!context || context.trim() === '') {
setTokenCount(0);
return;
}
const debouncedPost = debounce(axiosPost, 500);
const debouncedPost = debounce(axiosPost, 250);
const handleTextChange = context => {
debouncedPost({
url: '/api/tokenizer',