🐛 (editor) Flush code editor value when closing
This commit is contained in:
@ -5,7 +5,7 @@ import {
|
||||
useColorModeValue,
|
||||
useDisclosure,
|
||||
} from '@chakra-ui/react'
|
||||
import { useRef, useState } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useDebouncedCallback } from 'use-debounce'
|
||||
import { VariablesButton } from '@/features/variables'
|
||||
import { Variable } from 'models'
|
||||
@ -70,6 +70,13 @@ export const CodeEditor = ({
|
||||
setCarretPosition(codeEditor.current?.state?.selection.main.head ?? 0)
|
||||
}
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
setValue.flush()
|
||||
},
|
||||
[setValue]
|
||||
)
|
||||
|
||||
return (
|
||||
<HStack
|
||||
align="flex-end"
|
||||
|
Reference in New Issue
Block a user