Files
session-ios/SessionMessagingKit/Utilities/ObservableKeyEvent+Utilities.swift
Morgan Pretty 5e4b5c0989 Fixed a few bugs with the observation system and increased logs
• Tweaked some libSession error logs
• Added some more logs to the notification extension around group configs
• Updated a bunch of logic to be flagged as `@MainActor` to get compile level checks around thread safety
• Fixed a crash when joining a community
• Fixed an issue where some events wouldn't refresh data in an expected way
• Fixed an issue where the observation could be lost
2025-07-09 16:57:25 +10:00

22 lines
688 B
Swift

// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
import Foundation
import SessionUtilitiesKit
public extension LoadPageEvent {
func target<ID>(with current: PagedData.LoadResult<ID>) -> PagedData.Target<ID>? {
switch target {
case .initial: return .initial
case .nextPage(let lastIndex):
guard lastIndex == current.info.lastIndex else { return nil }
return .pageAfter
case .previousPage(let firstIndex):
guard firstIndex == current.info.firstPageOffset else { return nil }
return .pageBefore
}
}
}