authorcolor storage optimization, add undefined checks before access, code styling

This commit is contained in:
stoppegp committed 2020-04-07 20:30:55 +02:00
1 parent 79325b8cca
commit 56031a5c14
2 files changed
+60 -20

No files matched your search

+1 -1
View File
@@ -423,7 +423,7 @@ define([
var remoteDoc = newContent.content;
// setValueAndCursor triggers onLocal, even if we don't make any change to the content
// and it may revert other changes (metadata)
if (oldDoc === remoteDoc && authormarksUpdate == authormarksLocal) { return; }
if (oldDoc === remoteDoc && (authormarksUpdate === undefined || authormarksLocal === undefined || JSON.stringify(authormarksUpdate) === JSON.stringify(authormarksLocal))) { return; }
exp.setValueAndCursor(oldDoc, remoteDoc);
};