From 0e8829b929e04dca43fb2ae2cee487f6e572172d Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 2 Dec 2016 15:44:47 -0800 Subject: [PATCH] fix linter errors --- internal_packages/worker-sync/lib/delta-processor.es6 | 10 ++++------ src/flux/nylas-api.es6 | 1 - src/flux/tasks/syncback-metadata-task.es6 | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal_packages/worker-sync/lib/delta-processor.es6 b/internal_packages/worker-sync/lib/delta-processor.es6 index d846d8df9..bb24c527f 100644 --- a/internal_packages/worker-sync/lib/delta-processor.es6 +++ b/internal_packages/worker-sync/lib/delta-processor.es6 @@ -149,7 +149,7 @@ class DeltaProcessor { const byObjId = _.pluck(jsons, "object_id") return DatabaseStore.inTransaction(t => { - return _findModelsForMetadata(t, klass, Object.keys(byObjId)) + return this._findModelsForMetadata(t, klass, Object.keys(byObjId)) .then((models) => { if (!models || models.length === 0) return Promise.resolve() models.forEach((model) => { @@ -165,22 +165,20 @@ class DeltaProcessor { } _findModelsForMetadata(t, klass, ids) { - if (klass == Thread) { + if (klass === Thread) { // go through the Message table first, since local Thread IDs may be // the (static) ID of any Message in the thread // We prepend 't:' to thread IDs to avoid global object ID conflicts const messageIds = ids.map(i => i.slice(2)) return t.findAll(Message, {id: ids}).then((messages) => { - if (messages.length != messageIds.length) { + if (messages.length !== messageIds.length) { throw new Error(`Didn't find message for each thread. Thread IDs from remote: ${ids}`); } const threadIds = messages.map(m => m.threadId); return t.findAll(Thread, {id: threadIds}) }); } - else { - return t.findAll(klass, {id: ids}); - } + return t.findAll(klass, {id: ids}); } /** diff --git a/src/flux/nylas-api.es6 b/src/flux/nylas-api.es6 index f0805c689..24b94b0de 100644 --- a/src/flux/nylas-api.es6 +++ b/src/flux/nylas-api.es6 @@ -1,7 +1,6 @@ /* eslint global-require: 0 */ import _ from 'underscore' -import {remote} from 'electron' import NylasLongConnection from './nylas-long-connection' import NylasAPIRequest from './nylas-api-request' import Account from './models/account' diff --git a/src/flux/tasks/syncback-metadata-task.es6 b/src/flux/tasks/syncback-metadata-task.es6 index eab952dfa..24d703d85 100644 --- a/src/flux/tasks/syncback-metadata-task.es6 +++ b/src/flux/tasks/syncback-metadata-task.es6 @@ -30,6 +30,7 @@ export default class SyncbackMetadataTask extends SyncbackModelTask { body: { version: metadata.version, value: JSON.stringify(metadata.value), + objectType: this.modelClassName.toLowerCase(), }, }; return new NylasAPIRequest({