mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 01:54:40 +08:00
fix linter errors
This commit is contained in:
parent
7713a375eb
commit
0e8829b929
3 changed files with 5 additions and 7 deletions
|
@ -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});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue