Optimize Editor
This commit is contained in:
@@ -105,7 +105,7 @@ const CodeEditor = ({
|
||||
}
|
||||
}
|
||||
|
||||
const handleOnChangeFileContent = _.debounce((code: string = '') => {
|
||||
const handleOnChangeFileContent = (code: string = '') => {
|
||||
if (!files[onSelectedFileChange ? propsSelectedFileName : selectedFileName]) {
|
||||
return
|
||||
}
|
||||
@@ -116,7 +116,7 @@ const CodeEditor = ({
|
||||
onSelectedFileChange ? propsSelectedFileName : selectedFileName,
|
||||
clone
|
||||
)
|
||||
}, 250)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -26,14 +26,13 @@ import {
|
||||
strToBase64,
|
||||
TS_CONFIG_FILE_NAME
|
||||
} from '@/components/Playground/files'
|
||||
import compiler from '@/components/Playground/compiler'
|
||||
import FitFullscreen from '@/components/common/FitFullscreen'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
import HideScrollbar from '@/components/common/HideScrollbar'
|
||||
import Card from '@/components/common/Card'
|
||||
import CodeEditor from '@/components/Playground/CodeEditor'
|
||||
import Permission from '@/components/common/Permission'
|
||||
import { useState } from 'react'
|
||||
import compiler from '@/components/Playground/compiler.ts'
|
||||
|
||||
const Base = () => {
|
||||
const blocker = useBlocker(
|
||||
@@ -292,6 +291,7 @@ const Base = () => {
|
||||
key: 'uploading',
|
||||
duration: 0
|
||||
})
|
||||
// TODO Remove debug
|
||||
console.debug(result.outputFiles[0].text)
|
||||
void r_sys_tool_base_update({
|
||||
id: value.id,
|
||||
@@ -882,8 +882,10 @@ const Base = () => {
|
||||
|
||||
const handleOnChangeFileContent = (_content: string, _fileName: string, files: IFiles) => {
|
||||
setEditingFiles({ ...editingFiles, [editingBaseId]: files })
|
||||
if (!hasEdited[editingBaseId]) {
|
||||
setHasEdited({ ...hasEdited, [editingBaseId]: true })
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user