Skip to content

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

fix note sharing

ammarahm-edff118050a7c7
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 353bc3841..b3653a1de 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -153,7 +153,7 @@ export const ActionSheetComponent = ({
{
name: 'Share',
icon: 'share-variant',
- func: () => {
+ func: async () => {
if (note.locked) {
openVault({
item: item,
@@ -162,9 +162,8 @@ export const ActionSheetComponent = ({
share: true,
});
} else {
- close();
- let m = `${note.title}\n \n ${note.content.text}`;
-
+ let text = await db.notes.note(note.id).export('txt');
+ let m = `${note.title}\n \n ${text}`;
Share.open({
title: 'Share note to',
failOnCancel: false,
@@ -346,6 +345,7 @@ export const ActionSheetComponent = ({
<TouchableOpacity
onPress={rowItem.func}
key={rowItem.name}
+ testID={'icon-' + rowItem.name}
style={{
alignItems: 'center',
width: DDS.isTab
@@ -653,11 +653,9 @@ export const ActionSheetComponent = ({
{note.type === 'note' ? (
<PressableButton
- color={note.locked ? colors.errorBg : colors.shade}
- selectedColor={note.locked ? '#FF0000' : colors.accent}
- alpha={0.14}
+ accentColor="errorBg"
+ type={note.locked ? 'accent' : 'shade'}
onPress={onPressVaultButton}
- opacity={0.15}
customStyle={{
width: '95%',
alignSelf: 'center',
diff --git a/apps/mobile/src/components/VaultDialog/index.js b/apps/mobile/src/components/VaultDialog/index.js
index 8d5b2f820..5cf3fed0a 100644
--- a/apps/mobile/src/components/VaultDialog/index.js
+++ b/apps/mobile/src/components/VaultDialog/index.js
@@ -310,8 +310,17 @@ export class VaultDialog extends Component {
this.close();
}
+ toTXT(data) {
+ return data.reduce(function (text, op) {
+ if (!op.insert) return text;
+ if (typeof op.insert !== "string") return text + " ";
+ return text + op.insert;
+ }, "");
+ }
+
_shareNote(note) {
- let m = `${note.title}\n \n ${note.content.text}`;
+ let text = this.toTXT(note.content.data)
+ let m = `${note.title}\n \n ${text}`;
Share.open({
title: 'Share note to',
failOnCancel: false,