mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-19 13:09:30 +01:00
fix merge conflict resolution
This commit is contained in:
@@ -16,7 +16,6 @@ import Navigation from '../../services/Navigation';
|
|||||||
import Sync from '../../services/Sync';
|
import Sync from '../../services/Sync';
|
||||||
import {dHeight} from '../../utils';
|
import {dHeight} from '../../utils';
|
||||||
import {db} from '../../utils/database';
|
import {db} from '../../utils/database';
|
||||||
import diff from '../../utils/differ';
|
|
||||||
import {
|
import {
|
||||||
eApplyChanges,
|
eApplyChanges,
|
||||||
eShowMergeDialog,
|
eShowMergeDialog,
|
||||||
@@ -131,16 +130,20 @@ const MergeEditor = () => {
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
await db.notes.add({
|
await db.notes.add({
|
||||||
content: {
|
|
||||||
data: content.data,
|
|
||||||
type: content.type,
|
|
||||||
dateEdited: content.dateEdited,
|
|
||||||
remote: true,
|
|
||||||
dateResolved: secondaryData.dateEdited
|
|
||||||
},
|
|
||||||
id: note.id,
|
id: note.id,
|
||||||
|
conflicted: false,
|
||||||
|
dateEdited: content.dateEdited
|
||||||
|
});
|
||||||
|
|
||||||
|
await db.content.add({
|
||||||
|
id: note.contentId,
|
||||||
|
data: content.data,
|
||||||
|
type: content.type,
|
||||||
|
dateResolved: secondaryData.dateModified,
|
||||||
|
sessionId: Date.now(),
|
||||||
conflicted: false
|
conflicted: false
|
||||||
});
|
});
|
||||||
|
|
||||||
if (keepCopy) {
|
if (keepCopy) {
|
||||||
await db.notes.add({
|
await db.notes.add({
|
||||||
content: {
|
content: {
|
||||||
@@ -220,7 +223,6 @@ const MergeEditor = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
|
|
||||||
db.fs.cancel(primaryData?.noteId);
|
db.fs.cancel(primaryData?.noteId);
|
||||||
|
|
||||||
EV.unsubscribe(EVENTS.mediaAttachmentDownloaded, onMediaLoaded);
|
EV.unsubscribe(EVENTS.mediaAttachmentDownloaded, onMediaLoaded);
|
||||||
@@ -275,7 +277,7 @@ const MergeEditor = () => {
|
|||||||
paragraph="Apply selected changes to note?"
|
paragraph="Apply selected changes to note?"
|
||||||
padding={12}
|
padding={12}
|
||||||
/>
|
/>
|
||||||
<Seperator/>
|
<Seperator />
|
||||||
<DialogButtons
|
<DialogButtons
|
||||||
positiveTitle="Apply"
|
positiveTitle="Apply"
|
||||||
negativeTitle="Cancel"
|
negativeTitle="Cancel"
|
||||||
|
|||||||
Reference in New Issue
Block a user