onInvitesDone_(request) {
      let event = null;
      const activeUser = (request.result && request.result['request'] &&
                          request.result['request']['user']) ||
          '';
      if (request.xhr.status == 200 && request.result['success']) {
        // Extract invitations.
        const invitationListJson = request.result['invites'] || [];
        const invitationList = [];
        invitationListJson.forEach(function(invitationJson) {
          try {
            invitationList.push(
                cloudprint.parseInvitation(invitationJson, activeUser));
          } catch (e) {
            console.error('Unable to parse invitation: ' + e);
          }
        });
        // Dispatch INVITES_DONE event.
        event = new Event(CloudPrintInterfaceEventType.INVITES_DONE);
        event.invitations = invitationList;
      } else {
        event = this.createErrorEvent_(
            CloudPrintInterfaceEventType.INVITES_FAILED, request);
      }
      event.user = activeUser;
      this.dispatchEvent(event);
    }
/**
     * Called when invitations search request completes.
     * @param {!cloudprint.CloudPrintRequest} request Request that has been
     *     completed.
     * @private
     */
Called when invitations search request completes.
@param {!cloudprint.CloudPrintRequest} request Request that has been
completed.
@private
Called when invitations search request completes . @param { !cloudprint . CloudPrintRequest } request Request that has been completed . @private
onInvitesDone_(request) {
      let event = null;
      const activeUser = (request.result && request.result['request'] &&
                          request.result['request']['user']) ||
          '';
      if (request.xhr.status == 200 && request.result['success']) {
        const invitationListJson = request.result['invites'] || [];
        const invitationList = [];
        invitationListJson.forEach(function(invitationJson) {
          try {
            invitationList.push(
                cloudprint.parseInvitation(invitationJson, activeUser));
          } catch (e) {
            console.error('Unable to parse invitation: ' + e);
          }
        });
        event = new Event(CloudPrintInterfaceEventType.INVITES_DONE);
        event.invitations = invitationList;
      } else {
        event = this.createErrorEvent_(
            CloudPrintInterfaceEventType.INVITES_FAILED, request);
      }
      event.user = activeUser;
      this.dispatchEvent(event);
    }
onInvitesDone_ ( request ) { let event = null ; const activeUser = ( request . result && request . result [ 'request' ] && request . result [ 'request' ] [ 'user' ] ) || '' ; if ( request . xhr . status == 200 && request . result [ 'success' ] ) { const invitationListJson = request . result [ 'invites' ] || [ ] ; const invitationList = [ ] ; invitationListJson . forEach ( function ( invitationJson ) { try { invitationList . push ( cloudprint . parseInvitation ( invitationJson , activeUser ) ) ; } catch ( e ) { console . error ( 'Unable to parse invitation: ' + e ) ; } } ) ; event = new Event ( CloudPrintInterfaceEventType . INVITES_DONE ) ; event . invitations = invitationList ; } else { event = this . createErrorEvent_ ( CloudPrintInterfaceEventType . INVITES_FAILED , request ) ; } event . user = activeUser ; this . dispatchEvent ( event ) ; }
Called when invitations search request completes.
Called when invitations search request completes .
// Extract invitations. // Dispatch INVITES_DONE event.