mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-5071: Client side component of Telemetry. (#5516)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user