[local-sync] properly save folders when detecting thread

This commit is contained in:
Juan Tejada 2016-11-29 15:04:31 -08:00
parent ac818f30fe
commit 20be7cc513

View file

@ -145,9 +145,7 @@ function detectThread({db, message}) {
if (!isSent && ((message.date > thread.lastMessageReceivedDate) || !thread.lastMessageReceivedDate)) { if (!isSent && ((message.date > thread.lastMessageReceivedDate) || !thread.lastMessageReceivedDate)) {
thread.lastMessageReceivedDate = message.date; thread.lastMessageReceivedDate = message.date;
} }
if (!thread.folders.find(f => f.id === message.folderId)) {
thread.folders.push(message.folder)
}
return thread.save() return thread.save()
.then((saved) => { .then((saved) => {
const promises = [] const promises = []