peers view show no more than 1000 after filter

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-09-25 11:19:30 +08:00
parent a437524c8f
commit 5236dcfe52
2 changed files with 2 additions and 7 deletions

View File

@ -176,7 +176,8 @@ class _PeersViewState extends State<_PeersView> with WindowListener {
return FutureBuilder<List<Peer>>( return FutureBuilder<List<Peer>>(
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
final peers = snapshot.data!; var peers = snapshot.data!;
if (peers.length > 1000) peers = peers.sublist(0, 1000);
gFFI.peerTabModel.setCurrentTabCachedPeers(peers); gFFI.peerTabModel.setCurrentTabCachedPeers(peers);
buildOnePeer(Peer peer) { buildOnePeer(Peer peer) {
final visibilityChild = VisibilityDetector( final visibilityChild = VisibilityDetector(

View File

@ -173,9 +173,6 @@ class GroupModel {
} }
if (json.containsKey('total')) { if (json.containsKey('total')) {
if (total == 0) total = json['total']; if (total == 0) total = json['total'];
if (total > 1000) {
total = 1000;
}
if (json.containsKey('data')) { if (json.containsKey('data')) {
final data = json['data']; final data = json['data'];
if (data is List) { if (data is List) {
@ -188,9 +185,6 @@ class GroupModel {
} else { } else {
tmpPeers[index] = peer; tmpPeers[index] = peer;
} }
if (tmpPeers.length >= 1000) {
break;
}
} }
} }
} }