diff --git a/docs/working/DEBUGGING_TOOLS_IOS.md b/docs/working/DEBUGGING_TOOLS_IOS.md
index 2ba43e0..39193a9 100644
--- a/docs/working/DEBUGGING_TOOLS_IOS.md
+++ b/docs/working/DEBUGGING_TOOLS_IOS.md
@@ -2,7 +2,8 @@
[Go back to Working with react-native-router-flux](WORKING_WITH_REACT_NATIVE_ROUTER_FLUX.md)
-In the iOS simulator press Command+D to get the simulator debugger window (Command+M for Android)
+In the iOS simulator press Command+D to get the simulator debug menu (Command+M for Android). On a physical iPhone
+attached via a USB cord, shake the device to bring up the debug menu.
diff --git a/src/js/actions/TabActions.js b/src/js/actions/TabActions.js
index 7bbb105..040a618 100644
--- a/src/js/actions/TabActions.js
+++ b/src/js/actions/TabActions.js
@@ -1,7 +1,56 @@
+import { Actions } from 'react-native-router-flux';
import Dispatcher from "../dispatcher/Dispatcher";
+import RouteConst from "../scenes/RouteConst"
export default class TabActions {
+ static tabPressed (scene) {
+ /*
+ January 2018, Observed locations of the data we need, with
+ "react-native": "0.47.2"
+ "react-native-router-flux": "4.0.0-beta.24"
+ "flux": "3.1.3"
+ "react-router": "4.2.0"
+ "react-router-native": "4.2.0"
+ Observed locations of the data we need...
+ current key can be at
+ scene.route.key
+ scene.scene.route.key
+ previous key can be at
+ scene.previousScene.key
+ scene.scene.previousScene.key
+ */
+
+ let scene_local;
+ if (scene.route) {
+ scene_local = scene;
+ } else if (scene.scene.route) {
+ scene_local = scene.scene;
+ } else {
+ console.log("ERROR: tabPressed was unable to find a sceneLocal");
+ return;
+ }
+
+ let sceneLocal = scene_local;
+ let currentKey = sceneLocal.route.key;
+ let previousKey;
+ if (sceneLocal.previousScene) {
+ previousKey = sceneLocal.previousScene.key;
+ } else if (scene.previousScene) {
+ previousKey = scene.previousScene.key;
+ } else {
+ console.log("ERROR: tabPressed was unable to find a sceneLocalPrevious");
+ return;
+ }
+ console.log('TabActions.TabPress, currentKey = ' + currentKey + ', previousKey = ', previousKey + ',');
+ // if on the signin tab, and you click the sign in tab. A special case.
+ if (previousKey === RouteConst.KEY_SIGNIN_1 && previousKey === currentKey ) {
+ TabActions.tabStateChanged();
+ }
+
+ return Actions[scene_local.route.key].call();
+ }
+
static tabStateChanged () {
console.log('TabActions, received tabStateChanged');
Dispatcher.dispatch({
diff --git a/src/js/scenes/App.js b/src/js/scenes/App.js
index f2f902c..b7a9ff7 100644
--- a/src/js/scenes/App.js
+++ b/src/js/scenes/App.js
@@ -41,24 +41,7 @@ export default class App extends Component {
}
onTabPress(scene) {
- // console.log('App.js onTabPress, scene.previousScene.key = ' + scene.previousScene.key +
- // ', scene.route.key = ', scene.scene.route.key);
-
- let scene_local;
- if (scene.route) {
- scene_local = scene;
- } else if (scene.scene.route) {
- scene_local = scene.scene;
- } else {
- return;
- }
-
- // if on the signin tab, and you click the sign in tab. A special case.
- if (scene_local.previousScene && scene_local.previousScene.key === RouteConst.KEY_SIGNIN_1 && scene_local.previousScene.key === scene_local.route.key ) {
- TabActions.tabStateChanged();
- }
-
- return Actions[scene_local.route.key].call();
+ return TabActions.tabPressed(scene);
}
render() {
diff --git a/src/js/scenes/SignIn/AccountMenuModal.js b/src/js/scenes/SignIn/AccountMenuModal.js
index b1c2366..87fd168 100644
--- a/src/js/scenes/SignIn/AccountMenuModal.js
+++ b/src/js/scenes/SignIn/AccountMenuModal.js
@@ -11,6 +11,7 @@ import Modal from 'react-native-modal'
import { Actions } from 'react-native-router-flux';
import Icon from "react-native-vector-icons/FontAwesome";
+import CookieStore from "../../stores/CookieStore";
import styles from "../../stylesheets/components/baseStyles";
import styleConst from "../../stylesheets/styleConst";
import VoterSessionActions from "../../actions/VoterSessionActions";
@@ -173,9 +174,12 @@ export default class AccountMenu extends Component {
Our Promise: We'll never sell your email.
{/*Your Voter Guide (Twitter)*/}
{/*Your Voter Guide (Facebook)*/}
-
- Your Account
-
+
+ {isAuthenticated &&
+
+ Your Account
+
+ }
{! isAuthenticated &&
Sign In
diff --git a/src/js/scenes/SignIn/SignIn.js b/src/js/scenes/SignIn/SignIn.js
index 0913a48..8244674 100644
--- a/src/js/scenes/SignIn/SignIn.js
+++ b/src/js/scenes/SignIn/SignIn.js
@@ -301,7 +301,7 @@ export default class SignIn extends Component {
}
{isAuthenticated && Currently Signed In}
{isAuthenticatedTwitter &&
-
+
@@ -311,7 +311,7 @@ export default class SignIn extends Component {
}
{isAuthenticatedFacebook &&
-
+
diff --git a/src/js/stores/CookieStore.js b/src/js/stores/CookieStore.js
index 6783ab0..d47584a 100644
--- a/src/js/stores/CookieStore.js
+++ b/src/js/stores/CookieStore.js
@@ -1,8 +1,9 @@
import { Platform } from 'react-native';
import _ from "lodash";
import CookieManager from 'react-native-cookies';
-import { default as webAppConfig } from '../config';
import Promise from 'bluebird';
+import url from 'url';
+import { default as webAppConfig } from '../config';
const logging = require("../utils/logging");
// A wrapper class for react-native-cookie
@@ -19,9 +20,7 @@ class CookieStore {
directed to a specific route in the webapp that reassembles the url, uses the cookie to join the sessions.
*/
constructor() {
- let steve = webAppConfig.WE_VOTE_SERVER_ROOT_URL;
- console.log("steve steve steve " , steve);
- let host = new URL(webAppConfig.WE_VOTE_SERVER_ROOT_URL).hostname;
+ let host = url.parse(webAppConfig.WE_VOTE_SERVER_ROOT_URL).host;
this.state = {
urlString: webAppConfig.WE_VOTE_SERVER_ROOT_URL,
current_voter_device_id: '',
@@ -39,12 +38,12 @@ class CookieStore {
https://wevote.us/more/jump?jump_path=%2Fmore%2Ftools&voter_device_id=G834YIXbfsVB0z
*/
getJumpURLWithCookie(inUrlString) {
- let url = new URL(inUrlString);
+ let urlObject = url.parse(inUrlString);
let urlSearch = '';
if(urlSearch.length > 1) {
- urlSearch = '&' + url.search.substr(1); // '?key=value' to '&key=value'
+ urlSearch = '&' + urlObject.search.substr(1); // '?key=value' to '&key=value'
}
- let outUrlString = url.protocol + '//' + url.host + '/more/jump?jump_path=' + encodeURIComponent(url.pathname) +
+ let outUrlString = urlObject.protocol + '//' + urlObject.host + '/more/jump?jump_path=' + encodeURIComponent(urlObject.pathname) +
'&voter_device_id=' + this.state.current_voter_device_id + urlSearch;
console.log("getJumpURLWithCookie transformed '" + inUrlString + "' to '" + outUrlString + "'");
return outUrlString;