diff --git a/index.html b/index.html
index 1b5c26a2..743d01dc 100644
--- a/index.html
+++ b/index.html
@@ -51,8 +51,6 @@
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-60614729-2', 'auto');
diff --git a/js/actions/coa_actions.js b/js/actions/coa_actions.js
index 9af2841c..7c6f5118 100644
--- a/js/actions/coa_actions.js
+++ b/js/actions/coa_actions.js
@@ -7,7 +7,8 @@ import CoaFetcher from '../fetchers/coa_fetcher';
class CoaActions {
constructor() {
this.generateActions(
- 'updateCoa'
+ 'updateCoa',
+ 'flushCoa'
);
}
@@ -26,9 +27,7 @@ class CoaActions {
this.actions.updateCoa(res.coa);
})
.catch((err) => {
- console.log(err)
console.logGlobal(err);
- this.actions.updateCoa('Something went wrong, please try again later.');
});
}
}
diff --git a/js/actions/event_actions.js b/js/actions/event_actions.js
new file mode 100644
index 00000000..8f1def9f
--- /dev/null
+++ b/js/actions/event_actions.js
@@ -0,0 +1,19 @@
+'use strict';
+
+import alt from '../alt';
+
+
+class EventActions {
+ constructor() {
+ this.generateActions(
+ 'applicationWillBoot',
+ 'applicationDidBoot',
+ 'profileDidLoad',
+ //'userDidLogin',
+ //'userDidLogout',
+ 'routeDidChange'
+ );
+ }
+}
+
+export default alt.createActions(EventActions);
diff --git a/js/app.js b/js/app.js
index 13aa38a5..81a8fb82 100644
--- a/js/app.js
+++ b/js/app.js
@@ -5,7 +5,9 @@ require('babel/polyfill');
import React from 'react';
import Router from 'react-router';
+/* eslint-disable */
import fetch from 'isomorphic-fetch';
+/* eslint-enable */
import ApiUrls from './constants/api_urls';
import { updateApiUrls } from './constants/api_urls';
@@ -16,6 +18,16 @@ import requests from './utils/requests';
import { getSubdomainSettings } from './utils/constants_utils';
import { initLogging } from './utils/error_utils';
+import EventActions from './actions/event_actions';
+
+/* eslint-disable */
+// You can comment out the modules you don't need
+// import DebugHandler from './third_party/debug';
+import GoogleAnalyticsHandler from './third_party/ga';
+import RavenHandler from './third_party/raven';
+import IntercomHandler from './third_party/intercom';
+/* eslint-enable */
+
initLogging();
let headers = {
@@ -43,25 +55,30 @@ class AppGateway {
settings = getSubdomainSettings(subdomain);
appConstants.whitelabel = settings;
updateApiUrls(settings.type, subdomain);
- this.load(settings.type);
+ this.load(settings);
} catch(err) {
// if there are no matching subdomains, we're routing
// to the default frontend
console.logGlobal(err);
- this.load('default');
+ this.load();
}
}
- load(type) {
+ load(settings) {
+ let type = 'default';
+ if (settings) {
+ type = settings.type;
+ }
+
+ EventActions.applicationWillBoot(settings);
Router.run(getRoutes(type), Router.HistoryLocation, (App) => {
- if (window.ga) {
- window.ga('send', 'pageview');
- }
React.render(
@@ -426,8 +435,7 @@ let CoaDetails = React.createClass({