Skip to content

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

fix imports

ammarahm-ed85cb82a49e91
diff --git a/apps/mobile/src/components/NoteHistory/preview.js b/apps/mobile/src/components/NoteHistory/preview.js
index 835fb270d..ac9df7019 100644
--- a/apps/mobile/src/components/NoteHistory/preview.js
+++ b/apps/mobile/src/components/NoteHistory/preview.js
@@ -1,5 +1,5 @@
import React, {useRef} from 'react';
-import {Alert, View} from 'react-native';
+import {Alert, Platform, View} from 'react-native';
import WebView from 'react-native-webview';
import {useTracked} from '../../provider';
import {useEditorStore} from '../../provider/stores';
@@ -7,10 +7,11 @@ import {eSendEvent, ToastEvent} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import {db} from '../../utils/database';
import {eCloseProgressDialog, eOnLoadNote} from '../../utils/Events';
+import {openLinkInBrowser} from '../../utils/functions';
import {normalize} from '../../utils/SizeUtils';
import {getNote, sourceUri} from '../../views/Editor/Functions';
import tiny from '../../views/Editor/tiny/tiny';
-import { ActionIcon } from '../ActionIcon';
+import {ActionIcon} from '../ActionIcon';
import {Button} from '../Button';
import DialogHeader from '../Dialog/dialog-header';
import Paragraph from '../Typography/Paragraph';
@@ -51,7 +52,8 @@ export default function NotePreview({session, content}) {
}
const _onShouldStartLoadWithRequest = request => {
- if (request.url.includes('http')) {
+ if (request.url.includes('https')) {
+ if (Platform.OS === 'ios' && !request.isTopFrame) return;
openLinkInBrowser(request.url, colors)
.catch(e =>
ToastEvent.show({
@@ -95,7 +97,7 @@ export default function NotePreview({session, content}) {
return (
<View
style={{
- height:session.locked ? null : 600,
+ height: session.locked ? null : 600,
width: '100%'
}}>
<DialogHeader padding={12} title={session.session} />
@@ -126,7 +128,7 @@ export default function NotePreview({session, content}) {
cacheMode="LOAD_DEFAULT"
cacheEnabled={true}
source={{
- uri:"http://192.168.10.13:3000/plaineditor.html"
+ uri: 'http://192.168.10.13:3000/plaineditor.html'
//uri: sourceUri + 'plaineditor.html'
}}
/>
@@ -138,9 +140,9 @@ export default function NotePreview({session, content}) {
justifyContent: 'center',
alignItems: 'center'
}}>
- <Paragraph
- color={colors.icon}
- >Preview not available, content is encrypted.</Paragraph>
+ <Paragraph color={colors.icon}>
+ Preview not available, content is encrypted.
+ </Paragraph>
</View>
)}