Skip to content

Commit

Permalink
more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronvg committed Apr 16, 2024
1 parent 77b4a97 commit 4003f5c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ export const CodeMirrorEditor = ({ project }: { project: BAMLProject }) => {
onChange={async (val, viewUpdate) => {
setEditorFiles((prev) => {
const files = prev as EditorFile[] // because of jotai jsonstorage this becomes a promise or a normal object and this isnt a promise.
const fileIndex = files.findIndex((file) => file.path === activeFile?.path)
if (!activeFile) {
return files
}
const fileIndex = files.findIndex((file) => file.path === activeFile.path)

const updatedFile: EditorFile = {
path: activeFile?.path,
path: activeFile.path,
content: val,
}

Expand Down

0 comments on commit 4003f5c

Please sign in to comment.