[FIX] Share Extension shows a server that has no user logged in

This commit is contained in:
Reinaldo Neto 2022-06-08 00:12:08 -03:00
parent 748e87acf3
commit 34c121e7e8
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { NativeModules } from 'react-native';
import { isIOS } from '../methods/helpers';
import { isIOS } from '../methods/helpers/deviceInfo';
const { AppGroup } = NativeModules;

View File

@ -2,7 +2,7 @@ import { Database } from '@nozbe/watermelondb';
import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
import logger from '@nozbe/watermelondb/utils/common/logger';
import { isIOS } from '../methods/helpers';
import { isIOS } from '../methods/helpers/deviceInfo';
import appGroup from './appGroup';
import { isOfficial } from '../constants';
import Subscription from './model/Subscription';

View File

@ -27,7 +27,7 @@ import AuthLoadingView from './views/AuthLoadingView';
import { DimensionsContext } from './dimensions';
import { debounce } from './lib/methods/helpers';
import { ShareInsideStackParamList, ShareOutsideStackParamList, ShareAppStackParamList } from './definitions/navigationTypes';
import { colors, CURRENT_SERVER } from './lib/constants';
import { colors, CURRENT_SERVER, TOKEN_KEY } from './lib/constants';
initStore(store);
@ -120,8 +120,9 @@ class Root extends React.Component<{}, IState> {
init = async () => {
const currentServer = UserPreferences.getString(CURRENT_SERVER);
const userId = UserPreferences.getString(`${TOKEN_KEY}-${currentServer}`);
if (currentServer) {
if (currentServer && userId) {
await localAuthenticate(currentServer);
this.setState({ root: 'inside' });
await shareExtensionInit(currentServer);