fix(llc, ui): message search pagination
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -113,8 +113,9 @@ class ChannelQueryDao extends DatabaseAccessor<MoorChatDatabase>
|
||||
|
||||
cachedChannels.sort(chainedComparator);
|
||||
|
||||
if (paginationParams?.offset != null && cachedChannels.isNotEmpty) {
|
||||
cachedChannels.removeRange(0, paginationParams!.offset);
|
||||
final offset = paginationParams?.offset;
|
||||
if (offset != null && offset > 0 && cachedChannels.isNotEmpty) {
|
||||
cachedChannels.removeRange(0, offset);
|
||||
}
|
||||
|
||||
if (paginationParams?.limit != null) {
|
||||
|
||||
@@ -117,8 +117,9 @@ class MessageDao extends DatabaseAccessor<MoorChatDatabase>
|
||||
msgList.removeRange(0, greaterThanIndex);
|
||||
}
|
||||
}
|
||||
if (options?.limit != null) {
|
||||
return msgList.take(options!.limit).toList();
|
||||
final limit = options?.limit;
|
||||
if (limit != null && limit > 0) {
|
||||
return msgList.take(limit).toList();
|
||||
}
|
||||
}
|
||||
return msgList;
|
||||
|
||||
Reference in New Issue
Block a user