Skip to content

Commit

Permalink
UBERF-4229: Add more save attachment calls
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
  • Loading branch information
mixerka committed Nov 16, 2023
1 parent 9c70164 commit d9d0eb0
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { navigate } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { getObjectLinkFragment } from '@hcengineering/view-resources'
import { createEventDispatcher } from 'svelte'
import { createEventDispatcher, onDestroy } from 'svelte'
import AttachmentStyledBox from './AttachmentStyledBox.svelte'
export let object: Doc
Expand Down Expand Up @@ -105,6 +105,17 @@
saveTrigger = setTimeout(() => save(saveObject, saveDescription), 2500)
}
onDestroy(async () => {
// If change text and use mention link inside TextArea
// there is a case when createAttachments wouldn't be called
// because descriptionBox could be destroyed while
// we are doing await updateAttribute
// In that case it's better to call it from here, although
// I didn't find a way to loose any data.
// Check if no change is inside
await descriptionBox?.createAttachments()
})
export function isFocused (): boolean {
return descriptionBox.isFocused()
}
Expand Down

0 comments on commit d9d0eb0

Please sign in to comment.