Fixed an issue where we tried to delete protected files after import

pull/894/head
Morgan Pretty 3 months ago
parent c414e1b5fc
commit cfb02f42d3

@ -7923,7 +7923,7 @@
CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 533; CURRENT_PROJECT_VERSION = 534;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
@ -7999,7 +7999,7 @@
CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 533; CURRENT_PROJECT_VERSION = 534;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_MODULE_VERIFIER = YES; ENABLE_MODULE_VERIFIER = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;

@ -1265,9 +1265,18 @@ class DeveloperSettingsViewModel: SessionTableViewModel, NavigatableStateHolder,
at: URL( at: URL(
fileURLWithPath: dependencies[singleton: .fileManager].appSharedDataDirectoryPath fileURLWithPath: dependencies[singleton: .fileManager].appSharedDataDirectoryPath
), ),
includingPropertiesForKeys: [.isRegularFileKey] includingPropertiesForKeys: [.isRegularFileKey, .isHiddenKey]
) )
let fileUrls: [URL] = (deleteEnumerator?.allObjects.compactMap { $0 as? URL } ?? []) let fileUrls: [URL] = (deleteEnumerator?.allObjects
.compactMap { $0 as? URL }
.filter { url -> Bool in
guard let resourceValues = try? url.resourceValues(forKeys: [.isHiddenKey]) else {
return true
}
return (resourceValues.isHidden != true)
})
.defaulting(to: [])
try fileUrls.forEach { url in try fileUrls.forEach { url in
/// The database `wal` and `shm` files might not exist anymore at this point /// The database `wal` and `shm` files might not exist anymore at this point
/// so we should only remove files which exist to prevent errors /// so we should only remove files which exist to prevent errors

Loading…
Cancel
Save