fix: don't run autosync for localOnly items

This commit is contained in:
thecodrr
2022-03-31 11:46:48 +05:00
parent 2d6824cc73
commit b90858e199
3 changed files with 3 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ export class AutoSync {
* @private
*/
schedule(id, item) {
if (item && item.remote) return;
if (item && (item.remote || item.localOnly)) return;
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {

View File

@@ -28,7 +28,6 @@ export default class NoteHistory extends Collection {
this.sessionContent = await SessionContent.new(
this._db,
"sessioncontent",
this._collection.encryptionKeyFactory,
false
);
}
@@ -70,6 +69,7 @@ export default class NoteHistory extends Collection {
sessionContentId: makeSessionContentId(sessionId),
noteId,
dateCreated: oldSession ? oldSession.dateCreated : Date.now(),
localOnly: true,
};
if (locked) {

View File

@@ -17,6 +17,7 @@ export default class SessionContent extends Collection {
data: compressed || content.data,
type: content.type,
compressed: !!compressed,
localOnly: true,
locked,
});
}