mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
handle conflicted note
This commit is contained in:
@@ -152,6 +152,7 @@ const MergeEditor = () => {
|
|||||||
delta: primaryDelta,
|
delta: primaryDelta,
|
||||||
},
|
},
|
||||||
id: note.id,
|
id: note.id,
|
||||||
|
conflicted: false,
|
||||||
});
|
});
|
||||||
} else if (keepContentFrom === 'secondary') {
|
} else if (keepContentFrom === 'secondary') {
|
||||||
await db.notes.add({
|
await db.notes.add({
|
||||||
@@ -160,6 +161,7 @@ const MergeEditor = () => {
|
|||||||
delta: secondaryDelta,
|
delta: secondaryDelta,
|
||||||
},
|
},
|
||||||
id: note.id,
|
id: note.id,
|
||||||
|
conflicted: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +191,7 @@ const MergeEditor = () => {
|
|||||||
const show = async item => {
|
const show = async item => {
|
||||||
note = item;
|
note = item;
|
||||||
primaryDelta = await db.notes.note(note.id).delta();
|
primaryDelta = await db.notes.note(note.id).delta();
|
||||||
secondaryDelta = await db.notes.note(note.id).delta();
|
secondaryDelta = await db.notes.note(note.id).delta().conflicted;
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
postMessageToPrimaryWebView({
|
postMessageToPrimaryWebView({
|
||||||
type: 'delta',
|
type: 'delta',
|
||||||
|
|||||||
@@ -86,8 +86,11 @@ export default class NoteItem extends React.Component {
|
|||||||
activeOpacity={0.8}
|
activeOpacity={0.8}
|
||||||
onLongPress={() => onLongPress()}
|
onLongPress={() => onLongPress()}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
eSendEvent(eShowMergeDialog, item);
|
if (item.conflicted) {
|
||||||
return;
|
eSendEvent(eShowMergeDialog, item);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.props.selectionMode) {
|
if (this.props.selectionMode) {
|
||||||
this.props.onLongPress();
|
this.props.onLongPress();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user