Merge remote-tracking branch 'origin/stable'

# Conflicts:
#	db/demo.zip
#	src/services/notes.js
#	src/services/request.js
This commit is contained in:
zadam
2020-08-10 23:45:17 +02:00
15 changed files with 210 additions and 172 deletions

View File

@@ -288,6 +288,13 @@ class TreeCache {
async getNoteComplement(noteId) {
if (!this.noteComplementPromises[noteId]) {
this.noteComplementPromises[noteId] = server.get('notes/' + noteId).then(row => new NoteComplement(row));
// we don't want to keep large payloads forever in memory so we clean that up quite quickly
// this cache is more meant to share the data between different components within one business transaction (e.g. loading of the note into the tab context and all the components)
// this is also a work around for missing invalidation after change
this.noteComplementPromises[noteId].then(
() => setTimeout(() => this.noteComplementPromises[noteId] = null, 1000)
);
}
return await this.noteComplementPromises[noteId];