Skip to content

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

fix merge editor ui

ammarahm-ede14d5e10c437
diff --git a/apps/mobile/android/app/src/main/assets/plaineditor.html b/apps/mobile/android/app/src/main/assets/plaineditor.html
index b756b3d0e..06ad84aae 100644
--- a/apps/mobile/android/app/src/main/assets/plaineditor.html
+++ b/apps/mobile/android/app/src/main/assets/plaineditor.html
@@ -69,6 +69,7 @@
setTheme();
attachEditorListeners();
}
+ loadAction()
</script>
diff --git a/apps/mobile/html/Web.bundle/site/plaineditor.html b/apps/mobile/html/Web.bundle/site/plaineditor.html
index 53f807d78..61d471f0b 100644
--- a/apps/mobile/html/Web.bundle/site/plaineditor.html
+++ b/apps/mobile/html/Web.bundle/site/plaineditor.html
@@ -70,6 +70,7 @@
setTheme();
attachEditorListeners();
}
+ loadAction()
</script>
diff --git a/apps/mobile/src/components/MergeEditor/index.js b/apps/mobile/src/components/MergeEditor/index.js
index 0d339a299..d9ce61df0 100644
--- a/apps/mobile/src/components/MergeEditor/index.js
+++ b/apps/mobile/src/components/MergeEditor/index.js
@@ -141,10 +141,9 @@ const MergeEditor = () => {
};
const onMessageFromPrimaryWebView = (evt) => {
-
if (evt.nativeEvent.data !== '') {
let data = JSON.parse(evt.nativeEvent.data);
-
+
if (data.type === 'delta') {
primaryData = data.data;
}
@@ -152,11 +151,9 @@ const MergeEditor = () => {
};
const onMessageFromSecondaryWebView = (evt) => {
-
if (evt.nativeEvent.data === '') {
let data = JSON.parse(evt.nativeEvent.data);
if (data.type === 'delta') {
-
secondaryData = data.data;
}
}
@@ -362,6 +359,7 @@ const MergeEditor = () => {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
+ maxWidth: '50%',
}}>
<Icon
style={{
@@ -404,7 +402,10 @@ const MergeEditor = () => {
alignItems: 'center',
justifyContent: 'space-between',
}}>
- <Paragraph color={colors.icon} size={SIZE.xxs}>
+ <Paragraph
+ style={{maxWidth: '80%'}}
+ color={colors.icon}
+ size={SIZE.xs}>
Saved on {timeConverter(primaryData.dateEdited)}
</Paragraph>
<Icon
@@ -440,17 +441,21 @@ const MergeEditor = () => {
onPress={onPressDiscardFromPrimaryWebView}
/>
) : null}
- <View style={{width: 10}} />
{keepContentFrom === 'secondary' ? null : (
- <Button
- width={null}
- height={40}
- title={keepContentFrom === 'primary' ? 'Undo' : 'Keep'}
- onPress={onPressKeepFromPrimaryWebView}
- color={
- keepContentFrom === 'primary' ? colors.errorText : 'accent'
- }
- />
+ <>
+ <View style={{width: 10}} />
+ <Button
+ width={null}
+ height={40}
+ title={keepContentFrom === 'primary' ? 'Undo' : 'Keep'}
+ onPress={onPressKeepFromPrimaryWebView}
+ color={
+ keepContentFrom === 'primary'
+ ? colors.errorText
+ : 'accent'
+ }
+ />
+ </>
)}
</View>
</View>
@@ -507,6 +512,7 @@ const MergeEditor = () => {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
+ maxWidth: '50%',
}}>
<TouchableOpacity
onPress={() => {
@@ -537,7 +543,10 @@ const MergeEditor = () => {
alignItems: 'center',
justifyContent: 'space-between',
}}>
- <Paragraph color={colors.icon} size={SIZE.xs}>
+ <Paragraph
+ style={{maxWidth: '80%'}}
+ color={colors.icon}
+ size={SIZE.xs}>
Saved on {timeConverter(secondaryData.dateEdited)}
</Paragraph>
<Icon
@@ -573,18 +582,21 @@ const MergeEditor = () => {
onPress={onPressDiscardFromSecondaryWebView}
/>
) : null}
- <View style={{width: 10}} />
+
{keepContentFrom === 'primary' ? null : (
- <Button
- width={null}
- title={keepContentFrom === 'secondary' ? 'Undo' : 'Keep'}
- onPress={onPressKeepFromSecondaryWebView}
- color={
- keepContentFrom === 'secondary'
- ? colors.errorText
- : 'accent'
- }
- />
+ <>
+ <View style={{width: 10}} />
+ <Button
+ width={null}
+ title={keepContentFrom === 'secondary' ? 'Undo' : 'Keep'}
+ onPress={onPressKeepFromSecondaryWebView}
+ color={
+ keepContentFrom === 'secondary'
+ ? colors.errorText
+ : 'accent'
+ }
+ />
+ </>
)}
</View>
</View>