diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Controller/NoteController.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index f85c0bb..79b3b30 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -114,9 +114,19 @@ $recents['data'] = array(); foreach($recents['data'] as $item){ $path = $item['path']; - if($item['newpath'] != null) - $path =$item['newpath']; - if(!in_array($path, $paths)) + if(array_key_exists('newpath', $îtem) && $item['newpath'] != null){ + $path = $item['newpath']; + if(in_array($item['path'], $paths)){ + array_splice($paths, array_search($item['path'], $paths), 1); + } + + } + if($item['action'] == "remove"){ + if(in_array($item['path'], $paths)){ + array_splice($paths, array_search($item['path'], $paths), 1); + } + } + else if(!in_array($path, $paths)) array_push($paths, $path); } |