Skip to content

Commit d540f06

Browse files
committed
Merge pull request #85 from infinitered/saga-updates
[Base] Saga version and method updates + others
2 parents b30abd5 + 68f522c commit d540f06

File tree

16 files changed

+310
-29
lines changed

16 files changed

+310
-29
lines changed

ignite-base/App/Containers/AllComponentsScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class AllComponentsScreen extends React.Component {
4444
// Request premissions only if the user has logged in.
4545
const { loggedIn } = nextProps
4646
if (loggedIn) {
47-
console.log('Requesting push notification permissions.')
47+
if (__DEV__) console.log('Requesting push notification permissions.')
4848
PushNotification.requestPermissions()
4949
}
5050
}

ignite-base/App/Containers/LoginScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class LoginScreen extends Component {
111111
const textInputStyle = editable ? Styles.textInput : Styles.textInputReadonly
112112
return (
113113
<View style={[Styles.container, {height: this.state.visibleHeight}]}>
114-
<Image source={Images.logo} style={[Styles.topLogo, this.state.topLogo]}/>
114+
<Image source={Images.logo} style={[Styles.topLogo, this.state.topLogo]} />
115115
<View style={Styles.form}>
116116
<View style={Styles.row}>
117117
<Text style={Styles.rowLabel}>{I18n.t('username')}</Text>

ignite-base/App/Navigation/NavigationBarRouteMapper.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react-native'
2-
import { Text, View } from 'react-native'
1+
import React, { Text, View } from 'react-native'
32
// For some reason using this causes a crash: Investigate
43
// import { MapButton } from '../Components/Buttons/MapButton'
54
import NavButtons from './NavButtons'
@@ -8,8 +7,8 @@ import styles from './Styles/NavigationStyle'
87

98
export default {
109

11-
CreateButton (button_id, navigator) {
12-
switch (button_id) {
10+
CreateButton (buttonId, navigator) {
11+
switch (buttonId) {
1312
// case 'SEARCH':
1413
// return NavButtons.searchButton(navigator.state.tapSearch)
1514
// case 'MAP':

ignite-base/App/Navigation/Router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react-native'
1+
import React from 'react'
22
import { Transitions } from '../Themes/'
33

44
export default {

ignite-base/App/Root.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ PushNotification.configure({
1616

1717
// (optional) Called when Token is generated (iOS and Android)
1818
onRegister: (token) => {
19-
console.log('TOKEN:', token)
19+
if (__DEV__) console.log('TOKEN:', token)
2020
},
2121

2222
// (required) Called when a remote or local notification is opened or received
2323
onNotification: (notification) => {
24-
console.log('NOTIFICATION:', notification)
24+
if (__DEV__) console.log('NOTIFICATION:', notification)
2525
},
2626

2727
// ANDROID ONLY: (optional) GCM Sender ID.

ignite-base/App/Sagas/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { fork } from 'redux-saga/effects'
12
import API from '../Services/Api'
23
import { watchStartup } from './StartupSaga'
34
import { watchLoginAttempt } from './LoginSaga'
@@ -9,8 +10,8 @@ import getCityWeather from './GetCityWeatherSaga'
910
const api = API.create()
1011

1112
// start the daemons
12-
export default [
13-
watchStartup,
14-
watchLoginAttempt,
15-
getCityWeather(api).watcher
16-
]
13+
export default function * root () {
14+
yield fork(watchStartup)
15+
yield fork(watchLoginAttempt)
16+
yield fork(getCityWeather(api).watcher)
17+
}

ignite-base/App/Store/Store.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AsyncStorage } from 'react-native'
44
import createLogger from 'redux-logger'
55
import rootReducer, { persistentStoreBlacklist } from '../Reducers/'
66
import Config from '../Config/DebugSettings'
7-
import sagaMiddleware from 'redux-saga'
7+
import createSagaMiddleware from 'redux-saga'
88
import sagas from '../Sagas/'
99
import R from 'ramda'
1010
import immutablePersistenceTransform from './ImmutablePersistenceTransform'
@@ -19,11 +19,13 @@ const logger = createLogger({
1919
predicate: (getState, { type }) => USE_LOGGING && R.not(R.contains(type, SAGA_LOGGING_BLACKLIST))
2020
})
2121

22-
let middleware = [sagaMiddleware(...sagas)]
22+
let middleware = []
23+
const sagaMiddleware = createSagaMiddleware()
24+
middleware.push(sagaMiddleware)
2325

2426
// Don't ship these
2527
if (__DEV__) {
26-
middleware.push[logger]
28+
middleware.push(logger)
2729
}
2830

2931
// a function which can create our store and auto-persist the data
@@ -61,5 +63,8 @@ export default () => {
6163
)
6264
}
6365

66+
// run sagas
67+
sagaMiddleware.run(sagas)
68+
6469
return store
6570
}

ignite-base/android/app/app.iml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
12+
</configuration>
13+
</facet>
14+
</component>
15+
<component name="NewModuleRootManager" inherit-compiler-output="true">
16+
<exclude-output />
17+
<content url="file://$MODULE_DIR$" />
18+
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
19+
<orderEntry type="sourceFolder" forTests="false" />
20+
</component>
21+
</module>
52.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Mon Dec 28 10:00:20 PST 2015
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

0 commit comments

Comments
 (0)