1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Debounce deletion of un-referenced attachments --> don't fixes but mitigates the problems of #3103

This commit is contained in:
ehhc
2019-07-05 15:51:37 +02:00
committed by Junyoung Choi
parent d37210a0d0
commit 55a7ee1f91
2 changed files with 3 additions and 8 deletions

View File

@@ -53,6 +53,7 @@ export default class CodeEditor extends React.Component {
this.focusHandler = () => {
ipcRenderer.send('editor:focused', true)
}
const debouncedDeletionOfAttachments = _.debounce(attachmentManagement.deleteAttachmentsNotPresentInNote, 30000)
this.blurHandler = (editor, e) => {
ipcRenderer.send('editor:focused', false)
if (e == null) return null
@@ -64,16 +65,11 @@ export default class CodeEditor extends React.Component {
el = el.parentNode
}
this.props.onBlur != null && this.props.onBlur(e)
const {
storageKey,
noteKey
} = this.props
attachmentManagement.deleteAttachmentsNotPresentInNote(
this.editor.getValue(),
storageKey,
noteKey
)
debouncedDeletionOfAttachments(this.editor.getValue(), storageKey, noteKey)
}
this.pasteHandler = (editor, e) => {
e.preventDefault()