From ad69864f3b813fbc9b5bb2d856b9da4fd7ca5f8d Mon Sep 17 00:00:00 2001 From: Deepak Jha Date: Sat, 25 Mar 2017 13:25:11 +0000 Subject: [PATCH] added ydapp.in support --- imports/client/app/routes.js | 14 +++++++++++--- imports/client/views/nonOrg/enter/SignupView.js | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/imports/client/app/routes.js b/imports/client/app/routes.js index cc0e1b8..949f049 100644 --- a/imports/client/app/routes.js +++ b/imports/client/app/routes.js @@ -98,10 +98,18 @@ const authenticate = (nextState, replace) => { const detectOrg = () => { orgSlug = ""; var hostnameArray = document.location.hostname.split( "." ); - if(hostnameArray[1]=='localhost'){ - orgSlug = hostnameArray[0]; + if(hostnameArray[0] !== "www"){ + if((hostnameArray[1]==='localhost'||hostnameArray[1]==='ydapp')){ + orgSlug = hostnameArray[0]; + } + }else{ + if((hostnameArray[2]==='localhost'||hostnameArray[2]==='ydapp')){ + orgSlug = hostnameArray[1]; + } } - if(orgSlug!=""){ + + if(orgSlug!==""){ + console.log(orgSlug); Meteor.call('checkExistingOrg', {slug:orgSlug}, function(err, res) { if(res){ Session.set('orgId', res._id); diff --git a/imports/client/views/nonOrg/enter/SignupView.js b/imports/client/views/nonOrg/enter/SignupView.js index 31891cc..d7efcce 100644 --- a/imports/client/views/nonOrg/enter/SignupView.js +++ b/imports/client/views/nonOrg/enter/SignupView.js @@ -4,7 +4,7 @@ import { Icon } from '/imports/client/components/Icon' import { LinkContainer } from 'react-router-bootstrap'; import { Row, Col, FormGroup, ControlLabel, FormControl, - InputGroup, Button, + InputGroup, Button, Navbar,Modal, Nav, NavItem, Glyphicon, Collapse, NavbarToggler, NavbarBrand, @@ -34,7 +34,7 @@ export default class Signup extends React.Component { this.setState({ orgSlug: e.target.value }); } handleSubmit(event) { - event.preventDeult(); + event.preventDefault(); } checkExistingOrgSlug() { if(this.state.orgSlug==""){return null} -- 2.0.0