function updateFavourite(faves) {
  try {
    var links = getLinks(App.Agent.Hash, FAVOURITES, { Load: true });
    var oldHash = links[links.length - 1].Hash;
    var faveHash = update(FAVOURITES, faves, oldHash);

    commit('profile_links', {
      Links: [
        {
          Base: App.Agent.Hash,
          Link: oldHash,
          Tag: FAVOURITES,
          LinkAction: HC.LinkAction.Del
        }
      ]
    });

    commit('profile_links', {
      Links: [
        {
          Base: App.Agent.Hash,
          Link: faveHash,
          Tag: FAVOURITES
        }
      ]
    });
  } catch (exception) {
    debug('Error updating favourites: ' + exception);
  }
  faves.splice(0, 1);
  return faves;
}
/**
 * Helper function to update the fave array and the associated links:
 * @param faves is the array of favourites we want stored
 * @return updated array of faves
 **/
Helper function to update the fave array and the associated links:
@param faves is the array of favourites we want stored
@return updated array of faves
Helper function to update the fave array and the associated links : @param faves is the array of favourites we want stored @return updated array of faves
function updateFavourite(faves) {
  try {
    var links = getLinks(App.Agent.Hash, FAVOURITES, { Load: true });
    var oldHash = links[links.length - 1].Hash;
    var faveHash = update(FAVOURITES, faves, oldHash);
    commit('profile_links', {
      Links: [
        {
          Base: App.Agent.Hash,
          Link: oldHash,
          Tag: FAVOURITES,
          LinkAction: HC.LinkAction.Del
        }
      ]
    });
    commit('profile_links', {
      Links: [
        {
          Base: App.Agent.Hash,
          Link: faveHash,
          Tag: FAVOURITES
        }
      ]
    });
  } catch (exception) {
    debug('Error updating favourites: ' + exception);
  }
  faves.splice(0, 1);
  return faves;
}
function updateFavourite ( faves ) { try { var links = getLinks ( App . Agent . Hash , FAVOURITES , { Load : true } ) ; var oldHash = links [ links . length - 1 ] . Hash ; var faveHash = update ( FAVOURITES , faves , oldHash ) ; commit ( 'profile_links' , { Links : [ { Base : App . Agent . Hash , Link : oldHash , Tag : FAVOURITES , LinkAction : HC . LinkAction . Del } ] } ) ; commit ( 'profile_links' , { Links : [ { Base : App . Agent . Hash , Link : faveHash , Tag : FAVOURITES } ] } ) ; } catch ( exception ) { debug ( 'Error updating favourites: ' + exception ) ; } faves . splice ( 0 , 1 ) ; return faves ; }
Helper function to update the fave array and the associated links:
 @param faves is the array of favourites we want stored
 @return updated array of faves
Helper function to update the fave array and the associated links : @param faves is the array of favourites we want stored @return updated array of faves