Skip to content

Commit

Permalink
fix: editor ui height
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinko committed Dec 1, 2024
1 parent 4409d22 commit 6d206d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions src/components/BlinkoEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const BlinkoEditor = observer(({ mode, onSended, onHeightChange }: IProps
originFiles={!isCreateMode ? blinko.curSelectedNote?.attachments : []}
content={isCreateMode ? blinko.noteContent! : blinko.curSelectedNote?.content!}
onChange={v => {
onHeightChange?.(editorRef.current?.clientHeight ?? 75)
isCreateMode ? (blinko.noteContent = v) : (blinko.curSelectedNote!.content = v)
}}
onHeightChange={() => {
Expand All @@ -39,7 +38,6 @@ export const BlinkoEditor = observer(({ mode, onSended, onHeightChange }: IProps
isCreateMode ? <div className='text-xs text-ignore ml-2'>Drop to upload files</div> :
<div className='text-xs text-desc'>{dayjs(blinko.curSelectedNote!.createdAt).format("YYYY-MM-DD hh:mm:ss")}</div>
}

onSend={async ({ files }) => {
if (isCreateMode) {
//@ts-ignore
Expand Down
1 change: 1 addition & 0 deletions src/components/Common/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ const Editor = observer(({ content, onChange, onSend, isSendLoading, bottomSlot,
useEffect(() => {
store.updateSendStatus()
setIsWriting(ai.isWriting)
onHeightChange?.()
}, [blinko.noteTypeDefault, content, ai.isWriting, store.files?.length])

useEffect(() => {
Expand Down

0 comments on commit 6d206d4

Please sign in to comment.