Skip to content
This repository was archived by the owner on Sep 1, 2019. It is now read-only.

Commit 1252ad9

Browse files
committed
Removed files in .trash from visualizations
Checks if the filePath contains .Trash/ , and if it does, the FileInfo is not appended to the fileInfos array
1 parent 6bfc8a1 commit 1252ad9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

LocalStorage/Local Storage/Common.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,17 @@ func addToType(name: String, size: Int64, path: String) {
254254
let documentsPathEndIndex = path.index(AppState.documentsPath.endIndex, offsetBy: 1)
255255
let filePath = String(path[documentsPathEndIndex...])
256256

257-
AppState.types[n].size += size
258-
AppState.types[n].number += 1
259-
AppState.types[n].paths.append(filePath)
260-
AppState.types[n].sizes.append(size)
257+
if filePath.name.range(of: ".Trash/") {
258+
AppState.types[n].size += size
259+
AppState.types[n].number += 1
260+
AppState.types[n].paths.append(filePath)
261+
AppState.types[n].sizes.append(size)
261262

262-
AppState.files.allValues.append(Double(size))
263-
AppState.files.fileInfos.append(FileInfo(name: filePath, type: type_info.name))
263+
AppState.files.allValues.append(Double(size))
264+
AppState.files.fileInfos.append(FileInfo(name: filePath, type: type_info.name))
264265

265-
break
266+
break
267+
}
266268
}
267269
}
268270
}

0 commit comments

Comments
 (0)