Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Fix resolution undefined #847

Merged
merged 2 commits into from
Mar 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,17 @@ function syncKinto(client, credentials) {
lastModified: conflict.local.lastModified
};
} else {
const mergeWarning = browser.i18n.getMessage('mergeWarning');
let totalOps = conflict.remote.content;
resolution = {
id: conflict.remote.id,
content: conflict.remote.content
};

// If content is different we merge both.
// Could be difference on lastModified Date.
if (conflict.remote.content !== conflict.local.content) {
totalOps += `<p>${mergeWarning}</p>`;
totalOps += conflict.local.content;
resolution = {
id: conflict.remote.id,
content: totalOps,
};
const mergeWarning = browser.i18n.getMessage('mergeWarning');
resolution.content =
`${resolution.content}<p>${mergeWarning}</p>${conflict.local.content}`;
}

// We get earlier date for resolved conflict.
Expand Down