diff --git a/app/share.tsx b/app/share.tsx index e4836d501..2a241b76d 100644 --- a/app/share.tsx +++ b/app/share.tsx @@ -91,6 +91,8 @@ export const App = ({ root }: any) => ( ); class Root extends React.Component<{}, IState> { + private mounted = false; + constructor(props: any) { super(props); const { width, height, scale, fontScale } = Dimensions.get('screen'); @@ -107,6 +109,10 @@ class Root extends React.Component<{}, IState> { this.init(); } + componentDidMount() { + this.mounted = true; + } + componentWillUnmount(): void { closeShareExtension(); unsubscribeTheme(); @@ -119,8 +125,11 @@ class Root extends React.Component<{}, IState> { await localAuthenticate(currentServer); this.setState({ root: 'inside' }); await shareExtensionInit(currentServer); - } else { + } else if (this.mounted) { this.setState({ root: 'outside' }); + } else { + // @ts-ignore + this.state.root = 'outside'; } const state = Navigation.navigationRef.current?.getRootState(); diff --git a/yarn.lock b/yarn.lock index 611fedc64..b0bff0f05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8014,7 +8014,7 @@ detect-port@^1.3.0: address "^1.0.1" debug "^2.6.0" -detox@^19.7.0: +detox@19.7.0: version "19.7.0" resolved "https://registry.yarnpkg.com/detox/-/detox-19.7.0.tgz#278994beb98b959d21f1d4f393c628005c893122" integrity sha512-70a6IQCBQCJI21ITdK+qGUQ7fQL/CeOW+i0Vdr0ZFN5B5RylSE9d5shoJBtg2nb8XYG+S9BLqhn+uE02Nqymng==