Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yamsgithub committed May 31, 2017
2 parents 65cac15 + eadbf3c commit 20f353c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions client/src/components/Views.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ class ViewTabSnippets extends React.Component{
//If the tag already exits then it is removed from elasticsearch, in other case it is applied. If it is a Neutral tag then Relevant and Irrelevant tags are removed.
removeTags(arrayInputURL, tag){
var updatedPages = JSON.parse(JSON.stringify(this.state.pages));
var totalTagRemoved = 0;
//Removing Relevant, Irrelevant tag
for (var i in arrayInputURL) {
var url = arrayInputURL[i];
Expand All @@ -392,10 +393,11 @@ class ViewTabSnippets extends React.Component{
updatedPages[url]["tags"][auxKey] = tag;
}
if(!this.props.session['selected_tags'].split(",").includes(tag) && this.props.session['selected_tags'] !== "" ){
totalTagRemoved++;
delete updatedPages[url];
}
}
this.setState({ pages:updatedPages, });
this.setState({ pages:updatedPages, lengthTotalPages: this.state.lengthTotalPages - totalTagRemoved});
this.forceUpdate();

return updatedPages;
Expand Down Expand Up @@ -455,17 +457,17 @@ class ViewTabSnippets extends React.Component{
updatedPages[url]["tags"][auxKey] = tag;
//checking if the new tag belong to the filter
if(!this.props.session['selected_tags'].split(",").includes(tag) && this.props.session['selected_tags'] !== "" ){
this.setState({ pages:updatedPages, });
this.setState({ pages:updatedPages, lengthTotalPages: this.state.lengthTotalPages - 1});
delete updatedPages[url];
}
// setTimeout(function(){ $(nameIdButton).css('background-color','silver'); }, 500);
this.setState({ pages:updatedPages, });
this.setState({ pages:updatedPages});
this.removeAddTagElasticSearch(urls, tag, applyTagFlag ); //Add tag

}
else{
delete updatedPages[url]["tags"];
this.setState({ pages:updatedPages,});
this.setState({ pages:updatedPages});
this.removeAddTagElasticSearch(urls, tag, applyTagFlag );//Remove tag
}
}
Expand Down

0 comments on commit 20f353c

Please sign in to comment.