Skip to content

Commit

Permalink
add conditions around oauth-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Dec 11, 2021
1 parent 30b8a50 commit 407d284
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions generators/app/templates/app/config/app-config.js.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<%_ if (context.authenticationType === 'oauth2') { _%>
import { Platform } from 'react-native';
<%_ } _%>
import Constants from 'expo-constants';

// load extra config from the app.json file
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/app/config/redux-persist.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const REDUX_PERSIST = {
storeConfig: {
key: 'primary',
storage: AsyncStorage,
blacklist: ['appState', 'authInfo'], // reducer keys that you do NOT want stored to persistence here
blacklist: ['appState'<%_ if (context.authenticationType === 'oauth2') { _%>, 'authInfo'<%_ } _%>], // reducer keys that you do NOT want stored to persistence here
// whitelist: [], Optionally, just specify the keys you DO want stored to
// persistence. An empty array means 'don't store any reducers' -> infinitered/ignite#409
transforms: [immutablePersistenceTransform]
Expand Down
2 changes: 2 additions & 0 deletions generators/app/templates/app/navigation/nav-container.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ const linking = {
},
},
ModalScreen: 'alert',
<%_ if (context.authenticationType === 'oauth2') { _%>
OAuthRedirect: 'start',
<%_ } _%>
NotFound: '*',
},
},
Expand Down
2 changes: 1 addition & 1 deletion generators/heroku/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = class extends HerokuGenerator {
}

this.configOptions = {};
if (jhContext.configOptions) {
if (jhContext && jhContext.configOptions) {
this.configOptions = jhContext.configOptions;
}
}
Expand Down

0 comments on commit 407d284

Please sign in to comment.