...
 
Commits (12)
......@@ -43,10 +43,10 @@ jobs:
- store_artifacts:
path: test-results
ios:
macos:
xcode: "10.1"
xcode: "11.1.0"
working_directory: ~/mobile-native
# use a --login shell so our "set Ruby version" command gets picked up for later steps
......@@ -60,7 +60,7 @@ jobs:
command: brew install getsentry/tools/sentry-cli
- run:
name: set Ruby version
command: echo "ruby-2.4" > ~/.ruby-version
command: echo "ruby-2.6" > ~/.ruby-version
- restore_cache:
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
......@@ -94,6 +94,20 @@ jobs:
paths:
- vendor/bundle
- restore_cache:
key: pods-v1-{{ checksum "ios/Podfile.lock" }}-{{ arch }}
- run:
name: Install CocoaPods
command: pod install --verbose
working_directory: ios
- save_cache:
key: pods-v1-{{ checksum "ios/Podfile.lock" }}-{{ arch }}
paths:
- ios/Pods
### TODO- get tests running with fastlane
#- run:
......@@ -114,7 +128,7 @@ jobs:
#- store_artifacts:
# path: ios/test-results
- run:
- run:
name: Build release .ipa
command: fastlane buildrelease
working_directory: ios
......@@ -124,8 +138,8 @@ jobs:
- /release-*/
- test/circle-ci
- run:
name: Upload to crashalytics
- run:
name: Upload to crashalytics
command: echo "TODO"
working_directory: ios
branches:
......@@ -162,8 +176,8 @@ jobs:
command: |
apk add git
- checkout
- run:
name: Tag sentry release
- run:
name: Tag sentry release
command: |
version=`cat /tmp/workspace/version`
echo Tagging release with ${version}
......
......@@ -5,7 +5,6 @@
# Xcode
#
ios/Podfile.lock
build/
*.pbxuser
!default.pbxuser
......
......@@ -81,8 +81,9 @@ sessionService.onLogin(async () => {
});
logService.info('[App] Getting minds settings and onboarding progress');
// load minds settings and onboarding progresss on login
const results = await Promise.all([mindsService.getSettings(), stores.onboarding.getProgress(), boostedContentService.load()]);
// load minds settings and boosted content
await Promise.all([mindsService.getSettings(), boostedContentService.load()]);
logService.info('[App] updatting features');
// reload fatures on login
......@@ -92,16 +93,12 @@ sessionService.onLogin(async () => {
pushService.registerToken();
// get onboarding progress
const onboarding = results[1];
if (onboarding && onboarding.show_onboarding) {
sessionService.setInitialScreen('OnboardingScreen');
}
logService.info('[App] navigating to initial screen', sessionService.initialScreen);
NavigationService.navigate(sessionService.initialScreen);
// check onboarding progress and navigate if necessary
stores.onboarding.getProgress();
// check update
if (Platform.OS !== 'ios' && !GOOGLE_PLAY_STORE) {
setTimeout(async () => {
......@@ -199,8 +196,9 @@ export default class App extends Component<Props, State> {
*/
async componentDidMount() {
try {
// load app setting before start
const results = await Promise.all([settingsStore.init(), await Linking.getInitialURL()]),
const results = await Promise.all([settingsStore.init(), await Linking.getInitialURL()]);
deepLinkUrl = results[1];
......@@ -210,6 +208,7 @@ export default class App extends Component<Props, State> {
if (!this.handlePasswordResetDeepLink()) {
logService.info('[App] initializing session');
const token = await sessionService.init();
if (!token) {
......
......@@ -14,6 +14,7 @@ describe('Boosted content service', () => {
const fakeBoosts = [{guid: 1}, {guid: 2}, {guid: 3}];
boostedContentService.feedsService.getEntities.mockResolvedValue(fakeBoosts);
boostedContentService.feedsService.fetchLocal.mockResolvedValue(true);
// load the boosts
await boostedContentService.load();
......@@ -22,7 +23,7 @@ describe('Boosted content service', () => {
expect(boostedContentService.feedsService.setEndpoint).toBeCalledWith('api/v2/boost/feed');
expect(boostedContentService.feedsService.setOffset).toBeCalledWith(0);
expect(boostedContentService.feedsService.setLimit).toBeCalledWith(12);
expect(boostedContentService.feedsService.fetchRemoteOrLocal).toBeCalled();
expect(boostedContentService.feedsService.fetchLocal).toBeCalled();
// should fetch the boosts entities
expect(boostedContentService.feedsService.getEntities).toBeCalled();
......
......@@ -341,6 +341,7 @@
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 35U3998VRZ;
ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.Push = {
enabled = 1;
......@@ -763,6 +764,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Minds/Minds.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 35U3998VRZ;
......@@ -776,6 +779,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.minds.mobile;
PRODUCT_NAME = Minds;
PROVISIONING_PROFILE_SPECIFIER = "com.minds.mobile AppStore";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
......@@ -787,6 +791,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Minds/Minds.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 35U3998VRZ;
ENABLE_BITCODE = NO;
......@@ -799,6 +805,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.minds.mobile;
PRODUCT_NAME = Minds;
PROVISIONING_PROFILE = "4bb9ac5d-bab9-489d-87df-2ca73e3ee3c5";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.minds.mobile";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
......
This diff is collapsed.
......@@ -80,7 +80,7 @@
"rn-apk": "^0.2.9",
"socket.io-client": "^2.3.0",
"tipsi-stripe": "8.0.0-beta.8",
"web3": "1.0.0-beta.33"
"web3": "^1.2.2"
},
"devDependencies": {
"@babel/core": "^7.6.3",
......
......@@ -21,19 +21,34 @@ class BoostedContentService {
*/
load = async(): Promise<any> => {
try {
await this.feedsService
const done = await this.feedsService
.setLimit(12)
.setOffset(0)
.setPaginated(false)
.setEndpoint('api/v2/boost/feed')
.fetchRemoteOrLocal();
.fetchLocal();
if (!done) {
await this.update();
} else {
this.boosts = await this.feedsService.getEntities();
// refresh boost without the wait
this.update();
}
this.boosts = await this.feedsService.getEntities();
} catch (err) {
logService.exception('[BoostedContentService]', err);
}
}
/**
* Update boosted content from server
*/
async update() {
await this.feedsService.fetchRemote();
this.boosts = await this.feedsService.getEntities();
}
/**
* Fetch one boost
*/
......
......@@ -14,6 +14,12 @@ class MindsService {
*/
loadDefault = () => require("../../../settings/default.json");
async update() {
const settings = await api.get('api/v1/minds/config');
AsyncStorage.setItem('@MindsSettings', JSON.stringify(settings));
this.settings = this.settings;
}
/**
* Get settings
*/
......@@ -21,31 +27,14 @@ class MindsService {
let settings;
if (!this.settings) {
try {
settings = await api.get('api/v1/minds/config');
settings = JSON.parse(await AsyncStorage.getItem('@MindsSettings'));
if (!settings) throw Error('No settings stored');
} catch {
settings = this.loadDefault();
AsyncStorage.setItem('@MindsSettings', JSON.stringify(settings));
} catch (err) {
try {
settings = JSON.parse(await AsyncStorage.getItem('@MindsSettings'));
if (!settings) throw Error('No settings stored');
} catch {
settings = this.loadDefault();
AsyncStorage.setItem('@MindsSettings', JSON.stringify(settings));
}
}
if (settings) {
this.settings = settings;
} else {
return await new Promise(resolve => {
Alert.alert(
i18n.t('error'),
i18n.t('mindsSettings.error'),
[
{ text: i18n.t('retry'), onPress: async () => resolve(await this.getSettings()) }
]
);
});
}
this.settings = settings;
this.update();
}
return this.settings;
......
......@@ -9,6 +9,7 @@ import {
Text,
FlatList,
Dimensions,
RefreshControl,
View,
TouchableHighlight,
Keyboard,
......@@ -110,7 +111,7 @@ export default class DiscoveryScreen extends Component {
const params = this.props.navigation.state.params;
if (params && params.query) {
this.setQ(params.query);
params.query = null; //clean query
params.query = null; //clean query
}
}, 50);
});
......@@ -230,14 +231,16 @@ export default class DiscoveryScreen extends Component {
onLayout={this.onLayout}
key={'discofl' + this.cols} // we need to force component redering if we change cols
data={discovery.listStore.entities.slice()}
bounces={true}
refreshControl={
<RefreshControl refreshing={discovery.listStore.refreshing} onRefresh={this.refresh} progressViewOffset={146} />
}
renderItem={renderRow}
ListFooterComponent={footer}
CollapsibleHeaderComponent={this.getHeaders()}
headerHeight={(GOOGLE_PLAY_STORE && discovery.filters.type !== 'channels') ? 94 : 146}
ListEmptyComponent={this.getEmptyList()}
keyExtractor={this.keyExtractor}
onRefresh={this.refresh}
refreshing={discovery.listStore.refreshing}
onEndReached={this.loadMore}
initialNumToRender={this.cols == 3 ? 12 : 3}
style={[CS.backgroundWhite, CS.flexContainer]}
......
......@@ -4,6 +4,7 @@ import number from '../common/helpers/number';
import OffsetListStore from '../common/stores/OffsetListStore';
import logService from '../common/services/log.service';
import UserModel from '../channel/UserModel';
import NavigationService from '../navigation/NavigationService';
/**
* Onboarding store
......@@ -36,6 +37,9 @@ class OnboardingStore {
try {
const progress = await onboardingService.getProgress();
this.setProgress(progress);
if (progress && progress.show_onboarding) {
NavigationService.push('OnboardingScreen');
}
return progress;
} catch (err) {
logService.exception(err);
......
This diff is collapsed.