Skip to content

Commit

Permalink
Merge pull request #1756 from planetary-social/bdm/183-list-order
Browse files Browse the repository at this point in the history
fixed: lists change positions randomly #183

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
pelumy authored and joshuatbrown committed Feb 6, 2025
1 parent f1441e6 commit ebde9bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed: tapping a user on a list causes a crash. [#172](https://github.com/verse-pbc/issues/issues/172)
- Removed link to Listr.lol when list is empty. [#176](https://github.com/verse-pbc/issues/issues/176)
- Fixed: text fields sometimes don't work on onboarding screens. [#178](https://github.com/verse-pbc/issues/issues/178)
- Fixed: lists change positions randomly. [#183](https://github.com/verse-pbc/issues/issues/183)

### Internal Changes
- Added function for creating a new list and a test verifying list editing. [#112](https://github.com/verse-pbc/issues/issues/112)
Expand Down
6 changes: 1 addition & 5 deletions Nos/Controller/FeedController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ import SwiftUI
.publisher
.receive(on: DispatchQueue.main)
.sink(receiveValue: { [weak self] lists in
// ensure that we only publish the most recent list for each replaceable identifier
let grouped = Dictionary(grouping: lists, by: { $0.replaceableIdentifier ?? "" })
self?.lists = grouped.compactMap { _, events in
events.max(by: { $0.createdAt ?? Date.distantPast < $1.createdAt ?? Date.distantPast })
}
self?.lists = lists
})
.store(in: &cancellables)
}
Expand Down

0 comments on commit ebde9bc

Please sign in to comment.