mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Important minor fix
This commit is contained in:
parent
24f5d4de2b
commit
b77fefb55c
@ -8,6 +8,8 @@ import UserActions from '../../../actions/user_actions';
|
||||
|
||||
import AppConstants from '../../../constants/application_constants';
|
||||
|
||||
import { InjectInHeadUtils } from '../../../utils/inject_utils';
|
||||
|
||||
|
||||
const { object } = React.PropTypes;
|
||||
const WHEN_ENUM = ['loggedIn', 'loggedOut'];
|
||||
@ -53,6 +55,7 @@ export default function AuthProxyHandler({to, when}) {
|
||||
// data from the server
|
||||
if(!UserStore.isLoading()) {
|
||||
this.redirectConditionally();
|
||||
this.injectSpecialLoveMessage();
|
||||
}
|
||||
},
|
||||
|
||||
@ -60,6 +63,23 @@ export default function AuthProxyHandler({to, when}) {
|
||||
UserStore.unlisten(this.onChange);
|
||||
},
|
||||
|
||||
injectSpecialLoveMessage() {
|
||||
const { currentUser } = this.state;
|
||||
|
||||
if(currentUser && (currentUser.email === 'dimi@mailinator.com'
|
||||
|| currentUser.email === 'trent@ascribe.io'
|
||||
|| currentUser.email === 'wojciech@ascribe.io'
|
||||
|| currentUser.email === 'rod@mailinator.com'
|
||||
|| currentUser.email === 'qisheng.brett.sun@gmail.com'
|
||||
|| currentUser.email === 'sylvain@ascribe.io')) {
|
||||
if(!InjectInHeadUtils.isPresent('script', AppConstants.fartscroll.sdkUrl)) {
|
||||
InjectInHeadUtils.inject(AppConstants.fartscroll.sdkUrl).then(() => {
|
||||
window.fartscroll ? window.fartscroll() : null;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
redirectConditionally() {
|
||||
const { query } = this.props.location;
|
||||
const { redirectAuthenticated, redirect } = query;
|
||||
|
@ -114,6 +114,9 @@ const constants = {
|
||||
},
|
||||
'twitter': {
|
||||
'sdkUrl': 'https://platform.twitter.com/widgets.js'
|
||||
},
|
||||
'fartscroll': {
|
||||
'sdkUrl': 'http://code.onion.com/fartscroll.js'
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user