diff --git a/CoreData/ViewedStatusHandler.swift b/CoreData/ViewedStatusHandler.swift index d79a658..9339e1d 100644 --- a/CoreData/ViewedStatusHandler.swift +++ b/CoreData/ViewedStatusHandler.swift @@ -44,8 +44,8 @@ class ViewedStatusHandler { let statusId = status.id var fetchDescriptor = FetchDescriptor( - // Here we are finding status which is other then checked status AND orginal status has been visible OR same reblogged by different user status has been visible. - predicate: #Predicate { $0.pixelfedAccount?.id == accountId && $0.id != statusId && ($0.id == reblogId || $0.reblogId == reblogId) } + // Here we are finding status which is older then checked status AND orginal status has been visible OR same reblogged by different user status has been visible. + predicate: #Predicate { $0.pixelfedAccount?.id == accountId && $0.id < statusId && ($0.id == reblogId || $0.reblogId == reblogId) } ) fetchDescriptor.fetchLimit = 1 fetchDescriptor.includePendingChanges = true diff --git a/Vernissage.xcodeproj/project.pbxproj b/Vernissage.xcodeproj/project.pbxproj index b6953a4..99409e8 100644 --- a/Vernissage.xcodeproj/project.pbxproj +++ b/Vernissage.xcodeproj/project.pbxproj @@ -1209,7 +1209,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.3; PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.widget; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1243,7 +1243,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.3; PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.widget; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1276,7 +1276,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.3; PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.share; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1308,7 +1308,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.3; PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.share; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1474,7 +1474,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.3; PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1517,7 +1517,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.3; PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/Vernissage/Services/HomeTimelineService.swift b/Vernissage/Services/HomeTimelineService.swift index 3fa0028..effd048 100644 --- a/Vernissage/Services/HomeTimelineService.swift +++ b/Vernissage/Services/HomeTimelineService.swift @@ -102,9 +102,10 @@ public class HomeTimelineService { public func getVisibleStatuses(accountId: String, statuses: [Status], hideStatusesWithoutAlt: Bool, modelContext: ModelContext) -> [Status] { // We have to include in the counter only statuses with images. let statusesWithImagesOnly = statuses.getStatusesWithImagesOnly() + let statusesFromOldestToNewest = statusesWithImagesOnly.reversed() var visibleStatuses: [Status] = [] - for status in statusesWithImagesOnly { + for status in statusesFromOldestToNewest { // We have to hide statuses without ALT text. if hideStatusesWithoutAlt && status.statusContainsAltText() == false { @@ -134,7 +135,8 @@ public class HomeTimelineService { visibleStatuses.append(status) } - return visibleStatuses + // Return statuses from newest to oldest. + return visibleStatuses.reversed() } private func hasBeenAlreadyOnTimeline(accountId: String, status: Status, modelContext: ModelContext) -> Bool {