Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix merge conflict editor

ammarahm-edf9002d6038ea
diff --git a/apps/mobile/src/components/mergeconflicts/index.js b/apps/mobile/src/components/mergeconflicts/index.js
index 2cf3dc780..eb3f5087f 100644
--- a/apps/mobile/src/components/mergeconflicts/index.js
+++ b/apps/mobile/src/components/mergeconflicts/index.js
@@ -31,7 +31,7 @@ const MergeConflicts = () => {
const [copy, setCopy] = useState(null);
const [dialogVisible, setDialogVisible] = useState(false);
const insets = useSafeAreaInsets();
- const content = useRef({});
+ const content = useRef(null);
const isKeepingConflicted = !keep?.conflicted;
const isKeeping = !!keep;
@@ -48,7 +48,7 @@ const MergeConflicts = () => {
id: note.contentId,
data: _content.data,
type: _content.type,
- dateResolved: content.current.conflicted.dateModified,
+ dateResolved: content.current?.conflicted?.dateModified || Date.now(),
sessionId: Date.now(),
conflicted: false
});
@@ -289,7 +289,7 @@ const MergeConflicts = () => {
isCurrent={false}
isDiscarded={isKeeping && !isKeepingConflicted}
keeping={isKeeping}
- contentToKeep={content.current.conflicted || content.current}
+ contentToKeep={content.current.conflicted}
/>
<Animated.View
diff --git a/apps/mobile/src/screens/editor/loading.js b/apps/mobile/src/screens/editor/loading.js
index 28b8052a3..bcaec2883 100644
--- a/apps/mobile/src/screens/editor/loading.js
+++ b/apps/mobile/src/screens/editor/loading.js
@@ -108,37 +108,39 @@ const EditorOverlay = ({ editorId = '', editor }) => {
paddingTop: insets.top
}}
>
- <View
- style={{
- flexDirection: 'row',
- height: 50,
- alignItems: 'center',
- justifyContent: 'space-between',
- width: '100%',
- paddingLeft: 6,
- paddingRight: 12
- }}
- >
- <IconButton
- onPress={() => {
- eSendEvent(eClearEditor);
- opacity.value = 0;
- translateValue.value = 6000;
- }}
- name="arrow-left"
- color={colors.pri}
- />
-
+ {isDefaultEditor ? (
<View
style={{
flexDirection: 'row',
height: 50,
- alignItems: 'center'
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ width: '100%',
+ paddingLeft: 6,
+ paddingRight: 12
}}
>
- <IconButton name="dots-horizontal" color={colors.pri} />
+ <IconButton
+ onPress={() => {
+ eSendEvent(eClearEditor);
+ opacity.value = 0;
+ translateValue.value = 6000;
+ }}
+ name="arrow-left"
+ color={colors.pri}
+ />
+
+ <View
+ style={{
+ flexDirection: 'row',
+ height: 50,
+ alignItems: 'center'
+ }}
+ >
+ <IconButton name="dots-horizontal" color={colors.pri} />
+ </View>
</View>
- </View>
+ ) : null}
<View
style={{
@@ -147,32 +149,34 @@ const EditorOverlay = ({ editorId = '', editor }) => {
alignItems: 'flex-start'
}}
>
- <View
- style={{
- height: 30,
- backgroundColor: colors.nav,
- borderRadius: 100,
- marginBottom: 10,
- justifyContent: 'flex-start',
- alignItems: 'center',
- flexDirection: 'row',
- paddingHorizontal: 10,
- marginTop: 10
- }}
- >
- <Paragraph color={colors.icon} size={13}>
- Add a tag
- </Paragraph>
- <IconButton
- size={20}
- customStyle={{
- width: 26,
- height: 26
+ {isDefaultEditor ? (
+ <View
+ style={{
+ height: 30,
+ backgroundColor: colors.nav,
+ borderRadius: 100,
+ marginBottom: 10,
+ justifyContent: 'flex-start',
+ alignItems: 'center',
+ flexDirection: 'row',
+ paddingHorizontal: 10,
+ marginTop: 10
}}
- name="plus"
- color={colors.accent}
- />
- </View>
+ >
+ <Paragraph color={colors.icon} size={13}>
+ Add a tag
+ </Paragraph>
+ <IconButton
+ size={20}
+ customStyle={{
+ width: 26,
+ height: 26
+ }}
+ name="plus"
+ color={colors.accent}
+ />
+ </View>
+ ) : null}
<View
style={{