SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             const state = store.getState();
  2.             const channelId = event.data;
  3.             const channel = getChannel(state, channelId);
  4.  
  5.             const teamUrl = getCurrentRelativeTeamUrl(state);
  6.  
  7.             if (channel.fake || channel.userId) {
  8.                 const username = channel.userId ? channel.name : channel.display_name;
  9.                 const user = getUserByUsername(state, username);
  10.                 if (!user) {
  11.                     return {error: true};
  12.                 }
  13.  
  14.                 const direct = await dispatch(openDirectChannelToUserId(user.id));
  15.                 if (direct.error) {
  16.                     return {error: true};
  17.                 }
  18.                 browserHistory.push(`${teamUrl}/messages/@${channel.name}`);
  19.             } else if (channel.type === Constants.GM_CHANNEL) {
  20.                 const gmChannel = getChannel(state, channel.id);
  21.                 browserHistory.push(`${teamUrl}/channels/${gmChannel.name}`);
  22.             } else {
  23.                 browserHistory.push(`${teamUrl}/channels/${channel.name}`);
  24.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top