mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
• 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
22 lines
688 B
Swift
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
|
|
}
|
|
}
|
|
}
|