fix lint issues
This commit is contained in:
parent
ae908c0fed
commit
10b9cefc7e
|
@ -1,8 +1,8 @@
|
||||||
import RNConfigReader from 'react-native-config-reader';
|
import RNConfigReader from 'react-native-config-reader';
|
||||||
|
|
||||||
// Checks for undefined values
|
// Checks for undefined values
|
||||||
let fDroidBuild = RNConfigReader.FDROID_BUILD || false;
|
const fDroidBuild = RNConfigReader.FDROID_BUILD || false;
|
||||||
let officialBuild = RNConfigReader.OFFICIAL_BUILD || false;
|
const officialBuild = RNConfigReader.OFFICIAL_BUILD || false;
|
||||||
|
|
||||||
export const isOfficialBuild = officialBuild;
|
export const isOfficialBuild = officialBuild;
|
||||||
export const isFDroidBuild = fDroidBuild;
|
export const isFDroidBuild = fDroidBuild;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { getBundleId, isIOS } from '../utils/deviceInfo';
|
import { getBundleId, isIOS } from '../utils/deviceInfo';
|
||||||
import { isOfficialBuild } from './environment';
|
import { isOfficialBuild } from './environment';
|
||||||
|
|
||||||
let appStoreID = (isOfficialBuild) ? '1148741252' :'1272915472';
|
const appStoreID = (isOfficialBuild) ? '1148741252' : '1272915472';
|
||||||
const APP_STORE_ID = appStoreID;
|
const APP_STORE_ID = appStoreID;
|
||||||
|
|
||||||
export const PLAY_MARKET_LINK = `https://play.google.com/store/apps/details?id=${ getBundleId }`;
|
export const PLAY_MARKET_LINK = `https://play.google.com/store/apps/details?id=${ getBundleId }`;
|
||||||
|
|
|
@ -31,12 +31,8 @@ export const initLocalSettings = function* initLocalSettings() {
|
||||||
const restore = function* restore() {
|
const restore = function* restore() {
|
||||||
let hasMigration;
|
let hasMigration;
|
||||||
try {
|
try {
|
||||||
if (isOfficialBuild) {
|
if (isOfficialBuild || isIOS) {
|
||||||
hasMigration = yield AsyncStorage.getItem('hasMigration');
|
hasMigration = yield AsyncStorage.getItem('hasMigration');
|
||||||
} else {
|
|
||||||
if (isIOS) {
|
|
||||||
hasMigration = yield AsyncStorage.getItem('hasMigration');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let { token, server } = yield all({
|
let { token, server } = yield all({
|
||||||
|
@ -44,12 +40,17 @@ const restore = function* restore() {
|
||||||
server: RNUserDefaults.get('currentServer')
|
server: RNUserDefaults.get('currentServer')
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!hasMigration && isIOS) {
|
if (!hasMigration && (isIOS || isOfficialBuild)) {
|
||||||
let servers = yield RNUserDefaults.objectForKey(SERVERS);
|
let servers = yield RNUserDefaults.objectForKey(SERVERS);
|
||||||
// if not have current
|
// if not have current
|
||||||
if (servers && servers.length !== 0 && (!token || !server)) {
|
if (servers && servers.length !== 0 && (!token || !server)) {
|
||||||
server = servers[0][SERVER_URL];
|
server = servers[0][SERVER_URL];
|
||||||
token = servers[0][TOKEN];
|
if (isIOS) {
|
||||||
|
token = servers[0][TOKEN];
|
||||||
|
}
|
||||||
|
if(isOfficialBuild) {
|
||||||
|
token = servers[0][USER_ID].length > servers[0][TOKEN].length ? servers[0][USER_ID] : servers[0][TOKEN];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get native credentials
|
// get native credentials
|
||||||
|
|
|
@ -97,9 +97,9 @@ const handleSelectServer = function* handleSelectServer({ server, version, fetch
|
||||||
} else {
|
} else {
|
||||||
// We only run it if not has user on DB
|
// We only run it if not has user on DB
|
||||||
const servers = yield RNUserDefaults.objectForKey('kServers');
|
const servers = yield RNUserDefaults.objectForKey('kServers');
|
||||||
const userCredentials = servers && servers.find(srv => srv['kAuthServerURL'] === server);
|
const userCredentials = servers && servers.find(srv => srv.kAuthServerURL === server);
|
||||||
user = userCredentials && {
|
user = userCredentials && {
|
||||||
token: userCredentials['kAuthToken']
|
token: userCredentials.kAuthToken
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
} from './utils/theme';
|
} from './utils/theme';
|
||||||
import Navigation from './lib/ShareNavigation';
|
import Navigation from './lib/ShareNavigation';
|
||||||
import store from './lib/createStore';
|
import store from './lib/createStore';
|
||||||
import { supportSystemTheme } from './utils/deviceInfo';
|
import { supportSystemTheme, isAndroid } from './utils/deviceInfo';
|
||||||
import {
|
import {
|
||||||
defaultHeader, themedHeader, getActiveRouteName, navigationTheme
|
defaultHeader, themedHeader, getActiveRouteName, navigationTheme
|
||||||
} from './utils/navigation';
|
} from './utils/navigation';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { isOfficialBuild } from "./app/constants/environment";
|
import { isOfficialBuild } from './app/constants/environment';
|
||||||
|
|
||||||
let BugSnagApiKey = (isOfficialBuild) ? '0e62781637138bc11e6ad3ca14c03899' : '';
|
const BugSnagApiKey = (isOfficialBuild) ? '0e62781637138bc11e6ad3ca14c03899' : '';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
BUGSNAG_API_KEY: BugSnagApiKey
|
BUGSNAG_API_KEY: BugSnagApiKey
|
||||||
|
|
Loading…
Reference in New Issue