Fixed an issue where the blocked contacts screen might not show values

pull/991/head
Morgan Pretty 9 months ago
parent 26857376fb
commit 6a838a486c

@ -8109,7 +8109,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 = 467; CURRENT_PROJECT_VERSION = 468;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
@ -8187,7 +8187,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 = 467; CURRENT_PROJECT_VERSION = 468;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;

@ -186,14 +186,17 @@ public enum ObservationBuilder {
return TableObservation { viewModel, dependencies in return TableObservation { viewModel, dependencies in
subject subject
.withPrevious(([], StagedChangeset())) .withPrevious(([], StagedChangeset()))
.filter { prev, next in .handleEvents(
/// Suppress events with no changes (these will be sent in order to clear out the `StagedChangeset` value as if we receiveCancel: {
/// don't do so then resubscribing will result in an attempt to apply an invalid changeset to the `tableView` resulting /// When we unsubscribe we send through the existing data but clear out the `StagedChangeset` value
/// in a crash) /// so that resubscribing doesn't result in the UI trying to reapply the same changeset (which would cause a
!next.1.isEmpty /// crash due to invalid table view changes)
} subject.send((subject.value.0, StagedChangeset()))
}
)
.map { _, current -> ([T], StagedChangeset<[T]>) in current } .map { _, current -> ([T], StagedChangeset<[T]>) in current }
.setFailureType(to: Error.self) .setFailureType(to: Error.self)
.shareReplay(1)
.eraseToAnyPublisher() .eraseToAnyPublisher()
} }
} }

@ -203,6 +203,11 @@ public class SessionCell: UITableViewCell {
botSeparatorLeftConstraint = botSeparator.pin(.left, to: .left, of: cellBackgroundView) botSeparatorLeftConstraint = botSeparator.pin(.left, to: .left, of: cellBackgroundView)
botSeparatorRightConstraint = botSeparator.pin(.right, to: .right, of: cellBackgroundView) botSeparatorRightConstraint = botSeparator.pin(.right, to: .right, of: cellBackgroundView)
botSeparator.pin(.bottom, to: .bottom, of: cellBackgroundView) botSeparator.pin(.bottom, to: .bottom, of: cellBackgroundView)
// Explicitly call this to ensure we have initialised the constraints before we initially
// layout (if we don't do this then some constraints get created for the first time when
// updating the cell before the `isActive` value gets set, resulting in breaking constriants)
prepareForReuse()
} }
public override func layoutSubviews() { public override func layoutSubviews() {

@ -226,9 +226,9 @@ internal extension LibSession {
let joinedAt: TimeInterval = { let joinedAt: TimeInterval = {
guard let value: Int64 = group.joinedAt else { return 0 } guard let value: Int64 = group.joinedAt else { return 0 }
if value > 9_000_000_000_000 { // Microseconds (after May 1973) if value > 9_000_000_000_000 { // Microseconds
return (Double(value) / 1_000_000) return (Double(value) / 1_000_000)
} else if value > 9_000_000_000 { // Milliseconds (after September 2001) } else if value > 9_000_000_000 { // Milliseconds
return (Double(value) / 1000) return (Double(value) / 1000)
} }

@ -1084,10 +1084,7 @@ public enum PagedData {
// No need to do anything if there were no changes // No need to do anything if there were no changes
guard !changeset.isEmpty else { return } guard !changeset.isEmpty else { return }
// Need to send an event with the changes and then a second event to clear out the `StagedChangeset`
// value otherwise resubscribing will result with the changes coming through a second time
valueSubject?.send((updatedData, changeset)) valueSubject?.send((updatedData, changeset))
valueSubject?.send((updatedData, StagedChangeset()))
} }
// No need to dispatch to the next run loop if we are already on the main thread // No need to dispatch to the next run loop if we are already on the main thread

Loading…
Cancel
Save