mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-08 03:08:21 +00:00
Merge branch 'ishaan/dev2' of https://github.com/supermemoryai/supermemory into ishaan/dev2
This commit is contained in:
commit
b39c600083
1 changed files with 14 additions and 10 deletions
|
|
@ -236,16 +236,20 @@ export function DocumentModal({
|
|||
draftContentString !== initialEditorString &&
|
||||
draftContentString !== lastSavedContent
|
||||
|
||||
const handleSave = useCallback((submittedContent?: string) => {
|
||||
if (!_document?.id) return
|
||||
const content = submittedContent ?? draftContentString
|
||||
updateMutation.mutate(
|
||||
{ documentId: _document.id, content },
|
||||
{
|
||||
onSuccess: (_data, variables) => setLastSavedContent(variables.content),
|
||||
},
|
||||
)
|
||||
}, [_document?.id, draftContentString, updateMutation])
|
||||
const handleSave = useCallback(
|
||||
(submittedContent?: string) => {
|
||||
if (!_document?.id) return
|
||||
const content = submittedContent ?? draftContentString
|
||||
updateMutation.mutate(
|
||||
{ documentId: _document.id, content },
|
||||
{
|
||||
onSuccess: (_data, variables) =>
|
||||
setLastSavedContent(variables.content),
|
||||
},
|
||||
)
|
||||
},
|
||||
[_document?.id, draftContentString, updateMutation],
|
||||
)
|
||||
|
||||
const textEditorProps = useMemo(
|
||||
() => ({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue