mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 19:14:42 +08:00
tweaks (#1821)
* opt: _onTapUp * opt: set contains * opt: elementAtOrNull
This commit is contained in:
committed by
GitHub
parent
37fa165f59
commit
7260a387f9
@@ -10,7 +10,6 @@ import 'package:PiliPlus/pages/common/common_controller.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_tab/controller.dart';
|
||||
import 'package:PiliPlus/services/account_service.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/scroll_controller_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
@@ -33,7 +32,7 @@ class DynamicsController extends GetxController
|
||||
LoadingState<FollowUpModel>.loading().obs;
|
||||
late int _upPage = 1;
|
||||
late bool _upEnd = false;
|
||||
List<UpItem>? _cacheUpList;
|
||||
Set<UpItem>? _cacheUpList;
|
||||
late final _showAllUp = Pref.dynamicsShowAllFollowedUp;
|
||||
late bool showLiveUp = Pref.expandDynLivePanel;
|
||||
|
||||
@@ -150,7 +149,7 @@ class DynamicsController extends GetxController
|
||||
final first = res.first;
|
||||
if (first case final Success<FollowUpModel> i) {
|
||||
final data = i.response;
|
||||
final second = res.getOrNull(1);
|
||||
final second = res.elementAtOrNull(1);
|
||||
if (second case final Success<FollowData> j) {
|
||||
final data1 = j.response;
|
||||
final list1 = data1.list;
|
||||
@@ -161,8 +160,7 @@ class DynamicsController extends GetxController
|
||||
}
|
||||
|
||||
final list = data.upList;
|
||||
_cacheUpList = List<UpItem>.from(list);
|
||||
list.addAll(list1..removeWhere(list.contains));
|
||||
list.addAll(list1..removeWhere((_cacheUpList = list.toSet()).contains));
|
||||
}
|
||||
if (!_showAllUp) {
|
||||
if (data.hasMore == false || data.offset.isNullOrEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user