update all ToastEvent functions

This commit is contained in:
ammarahm-ed
2021-02-20 15:03:02 +05:00
parent 680db49990
commit 05d8bca5fd
32 changed files with 607 additions and 361 deletions

View File

@@ -32,7 +32,7 @@ import KeepAwake from '@sayem314/react-native-keep-awake';
import {timeConverter} from '../../utils/TimeUtils';
import tiny from '../../views/Editor/tiny/tiny';
import diff from '../../utils/differ';
import { openLinkInBrowser } from '../../utils/functions';
import {openLinkInBrowser} from '../../utils/functions';
const {Value, timing} = Animated;
@@ -133,10 +133,17 @@ const MergeEditor = () => {
const _onShouldStartLoadWithRequest = (request) => {
if (request.url.includes('http')) {
openLinkInBrowser(request.url, colors)
.catch((e) => ToastEvent.show(e.message, 'error'))
.then((r) => {
console.log('closed');
});
.catch((e) =>
ToastEvent.show({
title: 'Failed to open link',
message: e.message,
type: 'success',
context: 'local',
}),
)
.then((r) => {
console.log('closed');
});
return false;
} else {