B2G/gaia/apps/communications/contacts/js/importer_ui.js
/**
     *  This function is invoked when importing and updating operations
     *  finished
     */
This function is invoked when importing and updating operations
finished
This function is invoked when importing and updating operations finished
function onUpdate(numFriends) {
      function notifyParent(numFriends) {
        parent.postMessage({
          type: 'window_close',
          data: '',
          message: _('friendsUpdated', {
            numFriends: numFriends
          })
        }, targetApp);
      }
      serviceLogout(notifyLogout);
      if (Importer.getContext() === 'ftu') {
        Curtain.hide(function onhide() {
          notifyParent(numFriends);
        });
      } else {
        parent.postMessage({
          type: 'import_updated',
          data: ''
        }, targetApp);
        window.addEventListener('message', function finished(e) {
          if (e.origin !== targetApp) {
            return;
          }
          if (e.data.type === 'contacts_loaded') {
            Curtain.hide(function onhide() {
              notifyParent(numFriends);
            });
            window.removeEventListener('message', finished);
          }
        });
      }
    }
function onUpdate ( numFriends ) { function notifyParent ( numFriends ) { parent . postMessage ( { type : 'window_close' , data : '' , message : _ ( 'friendsUpdated' , { numFriends : numFriends } ) } , targetApp ) ; } serviceLogout ( notifyLogout ) ; if ( Importer . getContext ( ) === 'ftu' ) { Curtain . hide ( function onhide ( ) { notifyParent ( numFriends ) ; } ) ; } else { parent . postMessage ( { type : 'import_updated' , data : '' } , targetApp ) ; window . addEventListener ( 'message' , function finished ( e ) { if ( e . origin !== targetApp ) { return ; } if ( e . data . type === 'contacts_loaded' ) { Curtain . hide ( function onhide ( ) { notifyParent ( numFriends ) ; } ) ; window . removeEventListener ( 'message' , finished ) ; } } ) ; } }
This function is invoked when importing and updating operations
  finished
This function is invoked when importing and updating operations finished
// If the service requires to do the logout it is done // When the list of contacts is loaded and it's the current view // Please close me and display the number of friends updated