Track Notifier events so we know what % have toolbar/enabled/etc

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2017-05-29 19:15:52 +01:00
parent 541cea020e
commit b9457a0681
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ limitations under the License.
import MatrixClientPeg from './MatrixClientPeg';
import PlatformPeg from './PlatformPeg';
import TextForEvent from './TextForEvent';
import Analytics from './Analytics';
import Avatar from './Avatar';
import dis from './dispatcher';
import sdk from './index';
@ -121,6 +122,9 @@ const Notifier = {
setEnabled: function(enable, callback) {
const plaf = PlatformPeg.get();
if (!plaf) return;
Analytics.trackEvent('Notifier', 'Set Enabled', enable);
// make sure that we persist the current setting audio_enabled setting
// before changing anything
if (global.localStorage) {
@ -199,6 +203,8 @@ const Notifier = {
setToolbarHidden: function(hidden, persistent = true) {
this.toolbarHidden = hidden;
Analytics.trackEvent('Notifier', 'Set Toolbar Hidden', hidden);
// XXX: why are we dispatching this here?
// this is nothing to do with notifier_enabled
dis.dispatch({