Another tweak for the string linter and a couple of UI fixes
Fixed a minor UI bug with the ProfilePictureView when in a SessionCell Fixed a height calculation issue on the EditClosedGroupVC
This commit is contained in:
parent
6209f2b5c1
commit
613dbb4afa
|
@ -15,25 +15,30 @@ let currentPath = (
|
||||||
/// List of files in currentPath - recursive
|
/// List of files in currentPath - recursive
|
||||||
var pathFiles: [String] = {
|
var pathFiles: [String] = {
|
||||||
guard
|
guard
|
||||||
let enumerator = fileManager.enumerator(atPath: currentPath),
|
let enumerator: FileManager.DirectoryEnumerator = fileManager.enumerator(
|
||||||
let files = enumerator.allObjects as? [String]
|
at: URL(fileURLWithPath: currentPath),
|
||||||
|
includingPropertiesForKeys: [.isDirectoryKey],
|
||||||
|
options: [.skipsHiddenFiles]
|
||||||
|
),
|
||||||
|
let fileUrls: [URL] = enumerator.allObjects as? [URL]
|
||||||
else { fatalError("Could not locate files in path directory: \(currentPath)") }
|
else { fatalError("Could not locate files in path directory: \(currentPath)") }
|
||||||
|
|
||||||
return files
|
return fileUrls
|
||||||
.filter {
|
.filter {
|
||||||
!$0.starts(with: ".") && // Exclude hidden files (.git, .DS_STORE, etc.)
|
((try? $0.resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory == false) && // No directories
|
||||||
!$0.contains("Pods/") && // Exclude files under the pods folder
|
!$0.path.contains("Pods/") && // Exclude files under the pods folder
|
||||||
!$0.contains(".xcassets") && // Exclude asset bundles
|
!$0.path.contains(".xcassets") && // Exclude asset bundles
|
||||||
!$0.contains(".app/") && // Exclude files in the app build directories
|
!$0.path.contains(".app/") && // Exclude files in the app build directories
|
||||||
!$0.contains(".appex/") && // Exclude files in the extension build directories
|
!$0.path.contains(".appex/") && // Exclude files in the extension build directories
|
||||||
!$0.localizedCaseInsensitiveContains("tests/") && // Exclude files under test directories
|
!$0.path.localizedCaseInsensitiveContains("tests/") && // Exclude files under test directories
|
||||||
!$0.localizedCaseInsensitiveContains("external/") && ( // Exclude files under external directories
|
!$0.path.localizedCaseInsensitiveContains("external/") && ( // Exclude files under external directories
|
||||||
// Only include relevant files
|
// Only include relevant files
|
||||||
$0.hasSuffix("Localizable.strings") ||
|
$0.path.hasSuffix("Localizable.strings") ||
|
||||||
NSString(string: $0).pathExtension == "swift" ||
|
NSString(string: $0.path).pathExtension == "swift" ||
|
||||||
NSString(string: $0).pathExtension == "m"
|
NSString(string: $0.path).pathExtension == "m"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
.map { $0.path }
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
|
||||||
}
|
}
|
||||||
|
|
||||||
private func handleMembersChanged() {
|
private func handleMembersChanged() {
|
||||||
tableViewHeightConstraint.constant = CGFloat(membersAndZombies.count) * 72
|
tableViewHeightConstraint.constant = CGFloat(membersAndZombies.count) * 78
|
||||||
tableView.reloadData()
|
tableView.reloadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +440,6 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
|
||||||
}
|
}
|
||||||
|
|
||||||
let threadId: String = self.threadId
|
let threadId: String = self.threadId
|
||||||
let threadVariant: SessionThread.Variant = self.threadVariant
|
|
||||||
let updatedName: String = self.name
|
let updatedName: String = self.name
|
||||||
let userPublicKey: String = self.userPublicKey
|
let userPublicKey: String = self.userPublicKey
|
||||||
let updatedMemberIds: Set<String> = self.membersAndZombies
|
let updatedMemberIds: Set<String> = self.membersAndZombies
|
||||||
|
|
|
@ -55,10 +55,10 @@ extension SessionCell {
|
||||||
highlightingBackgroundLabel.pin(.trailing, to: .trailing, of: self, withInset: -Values.smallSpacing),
|
highlightingBackgroundLabel.pin(.trailing, to: .trailing, of: self, withInset: -Values.smallSpacing),
|
||||||
highlightingBackgroundLabel.pin(.bottom, to: .bottom, of: self)
|
highlightingBackgroundLabel.pin(.bottom, to: .bottom, of: self)
|
||||||
]
|
]
|
||||||
private lazy var profilePictureViewLeadingConstraint: NSLayoutConstraint = profilePictureView.pin(.leading, to: .leading, of: self)
|
|
||||||
private lazy var profilePictureViewTrailingConstraint: NSLayoutConstraint = profilePictureView.pin(.trailing, to: .trailing, of: self)
|
|
||||||
private lazy var profilePictureViewConstraints: [NSLayoutConstraint] = [
|
private lazy var profilePictureViewConstraints: [NSLayoutConstraint] = [
|
||||||
profilePictureView.pin(.top, to: .top, of: self),
|
profilePictureView.pin(.top, to: .top, of: self),
|
||||||
|
profilePictureView.pin(.leading, to: .leading, of: self),
|
||||||
|
profilePictureView.pin(.trailing, to: .trailing, of: self),
|
||||||
profilePictureView.pin(.bottom, to: .bottom, of: self)
|
profilePictureView.pin(.bottom, to: .bottom, of: self)
|
||||||
]
|
]
|
||||||
private lazy var searchBarConstraints: [NSLayoutConstraint] = [
|
private lazy var searchBarConstraints: [NSLayoutConstraint] = [
|
||||||
|
@ -269,8 +269,6 @@ extension SessionCell {
|
||||||
radioBorderViewHeightConstraint.isActive = false
|
radioBorderViewHeightConstraint.isActive = false
|
||||||
radioBorderViewConstraints.forEach { $0.isActive = false }
|
radioBorderViewConstraints.forEach { $0.isActive = false }
|
||||||
highlightingBackgroundLabelConstraints.forEach { $0.isActive = false }
|
highlightingBackgroundLabelConstraints.forEach { $0.isActive = false }
|
||||||
profilePictureViewLeadingConstraint.isActive = false
|
|
||||||
profilePictureViewTrailingConstraint.isActive = false
|
|
||||||
profilePictureViewConstraints.forEach { $0.isActive = false }
|
profilePictureViewConstraints.forEach { $0.isActive = false }
|
||||||
searchBarConstraints.forEach { $0.isActive = false }
|
searchBarConstraints.forEach { $0.isActive = false }
|
||||||
buttonConstraints.forEach { $0.isActive = false }
|
buttonConstraints.forEach { $0.isActive = false }
|
||||||
|
@ -458,10 +456,6 @@ extension SessionCell {
|
||||||
|
|
||||||
fixedWidthConstraint.constant = profileSize.viewSize
|
fixedWidthConstraint.constant = profileSize.viewSize
|
||||||
fixedWidthConstraint.isActive = true
|
fixedWidthConstraint.isActive = true
|
||||||
profilePictureViewLeadingConstraint.constant = (profileSize.viewSize > AccessoryView.minWidth ? 0 : Values.smallSpacing)
|
|
||||||
profilePictureViewTrailingConstraint.constant = (profileSize.viewSize > AccessoryView.minWidth ? 0 : -Values.smallSpacing)
|
|
||||||
profilePictureViewLeadingConstraint.isActive = true
|
|
||||||
profilePictureViewTrailingConstraint.isActive = true
|
|
||||||
profilePictureViewConstraints.forEach { $0.isActive = true }
|
profilePictureViewConstraints.forEach { $0.isActive = true }
|
||||||
|
|
||||||
case .search(let placeholder, let accessibility, let searchTermChanged):
|
case .search(let placeholder, let accessibility, let searchTermChanged):
|
||||||
|
|
|
@ -640,6 +640,9 @@ extension MessageReceiver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure the group still exists before inserting the info message
|
||||||
|
guard ClosedGroup.filter(id: threadId).isNotEmpty(db) else { return }
|
||||||
|
|
||||||
// Insert the info message for this group control message
|
// Insert the info message for this group control message
|
||||||
_ = try Interaction(
|
_ = try Interaction(
|
||||||
serverHash: message.serverHash,
|
serverHash: message.serverHash,
|
||||||
|
|
Loading…
Reference in New Issue