mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-03 04:31:46 +02:00
add simple error handler
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -195,7 +195,9 @@ function init_callback(_editor) {
|
||||
collapseElement(target);
|
||||
editor.getHTML().then(function (html) {
|
||||
reactNativeEventHandler('tiny', html);
|
||||
});
|
||||
}).catch(function(e) {
|
||||
reactNativeEventHandler('tinyerror', e.message);
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -612,7 +614,10 @@ const onChange = function (event) {
|
||||
changeTimer = setTimeout(function () {
|
||||
editor.getHTML().then(function (html) {
|
||||
reactNativeEventHandler('tiny', html);
|
||||
});
|
||||
}).catch(function(e) {
|
||||
reactNativeEventHandler('tinyerror', e.message);
|
||||
})
|
||||
|
||||
onUndoChange();
|
||||
selectchange();
|
||||
}, delay());
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent,
|
||||
presentSheet
|
||||
presentSheet,
|
||||
ToastEvent
|
||||
} from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import PremiumService from '../../services/PremiumService';
|
||||
@@ -459,6 +460,13 @@ export const _onMessage = async evt => {
|
||||
}
|
||||
|
||||
switch (message.type) {
|
||||
case 'tinyerror':
|
||||
ToastEvent.show({
|
||||
heading: 'An error occured',
|
||||
message: message.value,
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'tableconfig':
|
||||
showTableOptionsTooltip();
|
||||
break;
|
||||
|
||||
@@ -119,8 +119,8 @@ const Editor = React.memo(
|
||||
allowFileAccessFromFileURLs={true}
|
||||
allowUniversalAccessFromFileURLs={true}
|
||||
originWhitelist={['*']}
|
||||
source={source}
|
||||
//source={{uri:"http://192.168.10.13:5000/index.html"}}
|
||||
//source={source}
|
||||
source={{uri:"http://192.168.10.7:3000/index.html"}}
|
||||
style={style}
|
||||
autoManageStatusBarEnabled={false}
|
||||
onMessage={_onMessage}
|
||||
|
||||
Reference in New Issue
Block a user