diff options
author | Phie <phie@phie.ovh> | 2019-04-30 15:35:39 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-04-30 15:35:39 +0300 |
commit | 59e496950618821fcc9523e09d2c6ca356ff43f9 (patch) | |
tree | d48a06baec9f1bce025b0c42f7bafb5f2c78c9cd /lib | |
parent | fce3221fa82595d71da45340be8ef22db3ee7bca (diff) |
don't ask for removed notes
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); } |