From ebde9bcf7732f488814dcd8ee399659b03aa90ae Mon Sep 17 00:00:00 2001 From: Itunu Raimi Date: Thu, 6 Feb 2025 15:08:54 +0000 Subject: [PATCH] Merge pull request #1756 from planetary-social/bdm/183-list-order fixed: lists change positions randomly #183 # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 1 + Nos/Controller/FeedController.swift | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8577ed038..4b5f63fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Nos/Controller/FeedController.swift b/Nos/Controller/FeedController.swift index f6316b361..a4637778f 100644 --- a/Nos/Controller/FeedController.swift +++ b/Nos/Controller/FeedController.swift @@ -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) }