How to use the analytics.apiLogPublish function in analytics

To help you get started, we’ve selected a few analytics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lbryio / lbry-desktop / ui / redux / actions / publish.js View on Github external
const publishSuccess = successResponse => {
    const state = getState();
    const myClaims = selectMyClaims(state);
    const pendingClaim = successResponse.outputs[0];
    analytics.apiLogPublish(pendingClaim);
    const { permanent_url: url } = pendingClaim;
    const actions = [];

    // @if TARGET='app'
    actions.push(push(`/$/${PAGES.PUBLISHED}`));
    // @endif

    actions.push({
      type: ACTIONS.PUBLISH_SUCCESS,
    });
    // We have to fake a temp claim until the new pending one is returned by claim_list_mine
    // We can't rely on claim_list_mine because there might be some delay before the new claims are returned
    // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one
    const isMatch = claim => claim.claim_id === pendingClaim.claim_id;
    const isEdit = myClaims.some(isMatch);
github lbryio / lbry-desktop / src / ui / redux / actions / publish.js View on Github external
const publishSuccess = successResponse => {
    const state = getState();
    analytics.apiLogPublish();
    const myClaims = selectMyClaims(state);
    const pendingClaim = successResponse.outputs[0];
    const uri = pendingClaim.permanent_url;
    const actions = [];

    actions.push({
      type: ACTIONS.PUBLISH_SUCCESS,
    });
    // We have to fake a temp claim until the new pending one is returned by claim_list_mine
    // We can't rely on claim_list_mine because there might be some delay before the new claims are returned
    // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one
    const isMatch = claim => claim.claim_id === pendingClaim.claim_id;
    const isEdit = myClaims.some(isMatch);

    const myNewClaims = isEdit
      ? myClaims.map(claim => (isMatch(claim) ? pendingClaim : claim))
github lbryio / lbry-desktop / src / ui / redux / actions / publish.js View on Github external
const publishSuccess = successResponse => {
    const state = getState();
    const myClaims = selectMyClaims(state);
    const pendingClaim = successResponse.outputs[0];
    analytics.apiLogPublish(pendingClaim);
    const { permanent_url: url } = pendingClaim;
    const actions = [];

    actions.push({
      type: ACTIONS.PUBLISH_SUCCESS,
    });
    // We have to fake a temp claim until the new pending one is returned by claim_list_mine
    // We can't rely on claim_list_mine because there might be some delay before the new claims are returned
    // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one
    const isMatch = claim => claim.claim_id === pendingClaim.claim_id;
    const isEdit = myClaims.some(isMatch);

    const myNewClaims = isEdit
      ? myClaims.map(claim => (isMatch(claim) ? pendingClaim : claim))
      : myClaims.concat(pendingClaim);
    actions.push(doOpenModal(MODALS.PUBLISH, { uri: url, isEdit, filePath }));
github lbryio / lbry-desktop / ui / component / channelCreate / view.jsx View on Github external
const success = channelClaim => {
      this.setState({
        creatingChannel: false,
      });
      analytics.apiLogPublish(channelClaim);

      if (onSuccess !== undefined) {
        onSuccess({ ...this.props, ...this.state });
      }
    };