Guest User

Untitled

a guest
Nov 14th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. export default class Intercom extends PureComponent {
  2.  
  3. constructor(props) {
  4. super(props);
  5.  
  6. const settings = createSettingsForIntercom(props);
  7.  
  8. if (!appId || !canUseDOM) {
  9. return;
  10. }
  11.  
  12. loadIntercomWidget(appId, settings)
  13. bootIntercom(settings)
  14. }
  15.  
  16. componentDidMount() {
  17. const {
  18. getHMAC,
  19. user,
  20. isLoggedIn,
  21. } = this.props;
  22.  
  23. if (isLoggedIn) {
  24. getHMAC(user);
  25. } else {
  26. const settings = createSettingsForIntercom(this.props);
  27. shutdownIntercom()
  28. bootIntercom(settings);
  29. }
  30. }
  31.  
  32. render() {
  33. return false;
  34. }
  35. }
Add Comment
Please, Sign In to add comment