mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-28 18:14:08 +08:00
[*] fix(deltas): 0 as first cursor, deltas from redis are already JSON
This commit is contained in:
parent
7712269402
commit
5ff7a92197
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ const Rx = require('rx')
|
|||
const stream = require('stream');
|
||||
|
||||
function stringifyTransactions(db, transactions = []) {
|
||||
const transactionJSONs = transactions.map((t) => t.toJSON())
|
||||
const transactionJSONs = transactions.map((t) => (t.toJSON ? t.toJSON() : t))
|
||||
transactionJSONs.forEach((t) => { t.cursor = t.id });
|
||||
|
||||
const byModel = _.groupBy(transactionJSONs, "object");
|
||||
|
@ -57,7 +57,7 @@ module.exports = {
|
|||
buildCursor({databasePromise}) {
|
||||
return databasePromise.then(({Transaction}) => {
|
||||
return Transaction.findOne({order: [['id', 'DESC']]}).then((t) => {
|
||||
return (t || {}).id;
|
||||
return t ? t.id : 0;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue