Skip to content

Commit

Permalink
fixed doc filtering by favorite (issue #759)
Browse files Browse the repository at this point in the history
  • Loading branch information
pashist committed Apr 16, 2018
1 parent 7427a82 commit d5ad850
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@ angular.module('mean.icu.ui.officedocumentlist', [])
return t.recycled == null ;
})

if (possibleNavigate.length) {
if (possibleNavigate.length) {
if ($state.current.name === 'main.officeDocuments.all' ||
$state.current.name === 'main.officeDocuments.byentity' ||
$state.current.name === 'main.officeDocuments.all.details.activities'||
$state.current.name === 'main.officeDocuments.byentity.details.activities') {
var date = new Date();
var lastIndex = possibleNavigate.length-1;
var diff = date.getTime()-possibleNavigate[lastIndex].created.getTime();
if(possibleNavigate[lastIndex].title==""
&& diff<=2500){
var docDate = new Date(possibleNavigate[lastIndex].created);
var diff = date.getTime() - docDate.getTime();
if(possibleNavigate[lastIndex].title=='' && diff <= 2500) {
navigateToDetails(possibleNavigate[lastIndex]);
}
else{
else {
navigateToDetails(possibleNavigate[0]);
}
}
Expand Down

0 comments on commit d5ad850

Please sign in to comment.