You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
Mobile: Fixes #299: App freezes when connecting to OneDrive login page while internet connection is down
This commit is contained in:
@@ -4,7 +4,6 @@ const Icon = require('react-native-vector-icons/Ionicons').default;
|
||||
const ReactNativeActionButton = require('react-native-action-button').default;
|
||||
const { connect } = require('react-redux');
|
||||
const { globalStyle } = require('lib/components/global-style.js');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { _ } = require('lib/locale.js');
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
@@ -104,7 +104,7 @@ class NoteBodyViewer extends Component {
|
||||
style={webViewStyle}
|
||||
source={source}
|
||||
onLoadEnd={() => this.onLoadEnd()}
|
||||
onError={(e) => reg.logger().error('WebView error', e) }
|
||||
onError={() => reg.logger().error('WebView error') }
|
||||
onMessage={(event) => {
|
||||
let msg = event.nativeEvent.data;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { connect } = require('react-redux');
|
||||
const { ListView, Text, TouchableOpacity , View, StyleSheet } = require('react-native');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { _ } = require('lib/locale.js');
|
||||
const { Checkbox } = require('lib/components/checkbox.js');
|
||||
const { reg } = require('lib/registry.js');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { connect } = require('react-redux');
|
||||
const { ListView, Text, TouchableHighlight, Switch, View, StyleSheet } = require('react-native');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { _ } = require('lib/locale.js');
|
||||
const { Checkbox } = require('lib/components/checkbox.js');
|
||||
const { NoteItem } = require('lib/components/note-item.js');
|
||||
|
||||
@@ -2,7 +2,6 @@ const React = require('react'); const Component = React.Component;
|
||||
const { connect } = require('react-redux');
|
||||
const { Platform, View, Text, Button, StyleSheet, TouchableOpacity, Image, ScrollView, Dimensions } = require('react-native');
|
||||
const Icon = require('react-native-vector-icons/Ionicons').default;
|
||||
const { Log } = require('lib/log.js');
|
||||
const { BackButtonService } = require('lib/services/back-button.js');
|
||||
const NavService = require('lib/services/NavService.js');
|
||||
const { ReportService } = require('lib/services/report.js');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { View, Button, TextInput, StyleSheet } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { ActionButton } = require('lib/components/action-button.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const BaseModel = require('lib/BaseModel.js');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { ListView, View, Text, Button, StyleSheet, Platform } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { reg } = require('lib/registry.js');
|
||||
const { ScreenHeader } = require('lib/components/screen-header.js');
|
||||
const { time } = require('lib/time-utils');
|
||||
|
||||
@@ -2,7 +2,6 @@ const React = require('react'); const Component = React.Component;
|
||||
const { Platform, Keyboard, BackHandler, View, Button, TextInput, WebView, Text, StyleSheet, Linking, Image } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const { uuid } = require('lib/uuid.js');
|
||||
const { Log } = require('lib/log.js');
|
||||
const RNFS = require('react-native-fs');
|
||||
const Note = require('lib/models/Note.js');
|
||||
const Setting = require('lib/models/Setting.js');
|
||||
|
||||
@@ -3,7 +3,6 @@ const { View, Button, Text } = require('react-native');
|
||||
const { stateUtils } = require('lib/reducer.js');
|
||||
const { connect } = require('react-redux');
|
||||
const { reg } = require('lib/registry.js');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { NoteList } = require('lib/components/note-list.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const Tag = require('lib/models/Tag.js');
|
||||
|
||||
@@ -2,7 +2,6 @@ const React = require('react'); const Component = React.Component;
|
||||
const { View } = require('react-native');
|
||||
const { WebView, Button, Text } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const { Log } = require('lib/log.js');
|
||||
const Setting = require('lib/models/Setting.js');
|
||||
const { ScreenHeader } = require('lib/components/screen-header.js');
|
||||
const { reg } = require('lib/registry.js');
|
||||
@@ -44,8 +43,6 @@ class OneDriveLoginScreenComponent extends BaseScreenComponent {
|
||||
const parsedUrl = parseUri(url);
|
||||
|
||||
if (!this.authCode_ && parsedUrl && parsedUrl.queryKey && parsedUrl.queryKey.code) {
|
||||
Log.info('URL: ', url, parsedUrl.queryKey);
|
||||
|
||||
this.authCode_ = parsedUrl.queryKey.code
|
||||
|
||||
try {
|
||||
@@ -60,8 +57,8 @@ class OneDriveLoginScreenComponent extends BaseScreenComponent {
|
||||
}
|
||||
}
|
||||
|
||||
async webview_error(error) {
|
||||
Log.error(error);
|
||||
async webview_error() {
|
||||
alert('Could not load page. Please check your connection and try again.');
|
||||
}
|
||||
|
||||
retryButton_click() {
|
||||
@@ -93,7 +90,7 @@ class OneDriveLoginScreenComponent extends BaseScreenComponent {
|
||||
<WebView
|
||||
source={source}
|
||||
onNavigationStateChange={(o) => { this.webview_load(o); }}
|
||||
onError={(error) => { this.webview_error(error); }}
|
||||
onError={() => { this.webview_error(); }}
|
||||
/>
|
||||
<Button title={_("Refresh")} onPress={() => { this.retryButton_click(); }}></Button>
|
||||
</View>
|
||||
|
||||
@@ -2,7 +2,6 @@ const React = require('react'); const Component = React.Component;
|
||||
const { ListView, StyleSheet, View, Text, Button, FlatList } = require('react-native');
|
||||
const Setting = require('lib/models/Setting.js');
|
||||
const { connect } = require('react-redux');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { reg } = require('lib/registry.js');
|
||||
const { ScreenHeader } = require('lib/components/screen-header.js');
|
||||
const { time } = require('lib/time-utils');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { View, Text, StyleSheet } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const { Log } = require('lib/log.js');
|
||||
const { ScreenHeader } = require('lib/components/screen-header.js');
|
||||
const { ActionButton } = require('lib/components/action-button.js');
|
||||
const { BaseScreenComponent } = require('lib/components/base-screen.js');
|
||||
|
||||
@@ -2,7 +2,6 @@ const React = require('react'); const Component = React.Component;
|
||||
const { TouchableOpacity , Button, Text, Image, StyleSheet, ScrollView, View } = require('react-native');
|
||||
const { connect } = require('react-redux');
|
||||
const Icon = require('react-native-vector-icons/Ionicons').default;
|
||||
const { Log } = require('lib/log.js');
|
||||
const Tag = require('lib/models/Tag.js');
|
||||
const Note = require('lib/models/Note.js');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { connect } = require('react-redux');
|
||||
const { Log } = require('lib/log.js');
|
||||
const SideMenu_ = require('react-native-side-menu').default;
|
||||
|
||||
class SideMenuComponent extends SideMenu_ {};
|
||||
|
||||
Reference in New Issue
Block a user