Compare commits
No commits in common. "cbc1e88a37d136f1759dae5eff3e598bec104152" and "d8f7dc72d454d2fc024b4ffae03c2f71264eb64c" have entirely different histories.
cbc1e88a37
...
d8f7dc72d4
4 changed files with 11 additions and 31 deletions
4
App.js
4
App.js
|
|
@ -15,11 +15,11 @@ import Update from "./src/constants/Update";
|
|||
import ConnectionManager from "./src/managers/ConnectionManager";
|
||||
import URLHandler from "./src/utils/URLHandler";
|
||||
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
||||
import {enableScreens} from 'react-native-screens';
|
||||
import SplashScreen from 'react-native-splash-screen'
|
||||
|
||||
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
||||
// Crashes app when navigating away from webview on android 9+
|
||||
// enableScreens(true);
|
||||
enableScreens(true);
|
||||
|
||||
|
||||
YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class ErrorView extends React.PureComponent<Props, State> {
|
|||
|
||||
const styles = StyleSheet.create({
|
||||
outer: {
|
||||
height: '100%',
|
||||
height: '99%', // using 100% crashes planex screen for some reason on android 9+
|
||||
},
|
||||
inner: {
|
||||
marginTop: 'auto',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ type Props = {
|
|||
collapsibleStack: Object,
|
||||
onMessage: Function,
|
||||
onScroll: Function,
|
||||
showAdvancedControls: boolean,
|
||||
}
|
||||
|
||||
const AnimatedWebView = Animated.createAnimatedComponent(WebView);
|
||||
|
|
@ -30,7 +29,6 @@ class WebViewScreen extends React.PureComponent<Props> {
|
|||
|
||||
static defaultProps = {
|
||||
customJS: '',
|
||||
showAdvancedControls: true,
|
||||
};
|
||||
|
||||
webviewRef: Object;
|
||||
|
|
@ -47,10 +45,9 @@ class WebViewScreen extends React.PureComponent<Props> {
|
|||
* Creates refresh button after mounting
|
||||
*/
|
||||
componentDidMount() {
|
||||
const rightButton = this.getRefreshButton.bind(this);
|
||||
this.props.navigation.setOptions({
|
||||
headerRight: this.props.showAdvancedControls
|
||||
? this.getAdvancedButtons
|
||||
: this.getBasicButton,
|
||||
headerRight: rightButton,
|
||||
});
|
||||
this.props.navigation.addListener(
|
||||
'focus',
|
||||
|
|
@ -83,22 +80,7 @@ class WebViewScreen extends React.PureComponent<Props> {
|
|||
*
|
||||
* @return {*}
|
||||
*/
|
||||
getBasicButton = () => {
|
||||
return (
|
||||
<MaterialHeaderButtons>
|
||||
<Item
|
||||
title="refresh"
|
||||
iconName="refresh"
|
||||
onPress={this.onRefreshClicked}/>
|
||||
<Item
|
||||
title={i18n.t("general.openInBrowser")}
|
||||
iconName="open-in-new"
|
||||
onPress={this.onOpenClicked}/>
|
||||
</MaterialHeaderButtons>
|
||||
);
|
||||
};
|
||||
|
||||
getAdvancedButtons = () => {
|
||||
getRefreshButton() {
|
||||
return (
|
||||
<MaterialHeaderButtons>
|
||||
<Item
|
||||
|
|
@ -119,7 +101,7 @@ class WebViewScreen extends React.PureComponent<Props> {
|
|||
onPress={this.onOpenClicked}/>
|
||||
</MaterialHeaderButtons>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Callback to use when refresh button is clicked. Reloads the webview.
|
||||
|
|
|
|||
|
|
@ -207,11 +207,10 @@ class PlanexScreen extends React.Component<Props, State> {
|
|||
+ 'true;'; // Prevents crash on ios
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps: Props): boolean {
|
||||
if (nextProps.theme.dark !== this.props.theme.dark)
|
||||
this.generateInjectedJS(this.state.currentGroup.id);
|
||||
return true;
|
||||
}
|
||||
// componentWillUpdate(prevProps: Props) {
|
||||
// if (prevProps.theme.dark !== this.props.theme.dark)
|
||||
// this.generateInjectedCSS();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Callback used when closing the banner.
|
||||
|
|
@ -292,7 +291,6 @@ class PlanexScreen extends React.Component<Props, State> {
|
|||
customJS={this.customInjectedJS}
|
||||
onMessage={this.onMessage}
|
||||
onScroll={this.onScroll}
|
||||
showAdvancedControls={false}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue