PLT-5071: Client side component of Telemetry. (#5516)

This commit is contained in:
George Goldberg
2017-02-24 17:34:21 +00:00
committed by GitHub
parent f182d196ff
commit 97cc0a0d73
23 changed files with 280 additions and 129 deletions

View File

@@ -10,6 +10,7 @@ import * as ChannelUtils from 'utils/channel_utils.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx';
import {trackEvent} from 'actions/diagnostics_actions.jsx';
import Client from 'client/web_client.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
@@ -171,6 +172,7 @@ export function openDirectChannelToUser(user, success, error) {
const channel = ChannelStore.getByName(channelName);
if (channel) {
trackEvent('api', 'api_channels_join_direct');
PreferenceStore.setPreference(Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, user.id, 'true');
loadProfilesAndTeamMembersForDMSidebar();
@@ -224,10 +226,12 @@ export function openDirectChannelToUser(user, success, error) {
}
export function markFavorite(channelId) {
trackEvent('api', 'api_channels_favorited');
AsyncClient.savePreference(Preferences.CATEGORY_FAVORITE_CHANNEL, channelId, 'true');
}
export function unmarkFavorite(channelId) {
trackEvent('api', 'api_channels_unfavorited');
const pref = {
user_id: UserStore.getCurrentId(),
category: Preferences.CATEGORY_FAVORITE_CHANNEL,