Skip to content

Commit

Permalink
fixup! Fix leave share for root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Altahrim committed Aug 31, 2023
1 parent 5ce1a86 commit fbff5f0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/FileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,17 @@ public function finalizeChanges(Folder $folder): bool {
* @return array{to_save: Node[], to_delete: Node[]}
*/
private function getIntermediateFiles(Folder $folder): array {
$result = [
'to_save' => [],
'to_delete' => [],
];

// Special case when root folder is deleted/unshared
if ($this->isIntermediateFileToDelete($folder)) {
return [
'to_save' => [],
'to_delete' => [$folder]
];
$result['to_delete'][] = $folder;
}

$listing = $folder->getDirectoryListing();
$result = [
'to_save' => [],
'to_delete' => [],
];

foreach ($listing as $node) {
if ($this->isIntermediateFileToSave($node)) {
Expand Down

0 comments on commit fbff5f0

Please sign in to comment.