mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: blacklist (#501)
This commit is contained in:
committed by
GitHub
parent
a8428e52d2
commit
edf84fcc8f
@@ -26,11 +26,12 @@ class _BlackListPageState extends State<BlackListPage> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
List list = _blackListController.loadingState.value is Success
|
||||
? (_blackListController.loadingState.value as Success).response
|
||||
final list = _blackListController.loadingState.value is Success
|
||||
? ((_blackListController.loadingState.value as Success).response
|
||||
as List)
|
||||
.cast<BlackListItem>()
|
||||
: <BlackListItem>[];
|
||||
GStorage.setBlackMidsList(
|
||||
list.isNotEmpty ? list.map((e) => e.mid!).toList() : <int>[]);
|
||||
GStorage.blackMids = list.map((e) => e.mid!).toSet();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ class RcmdController extends CommonController {
|
||||
bool shouldSaveLast =
|
||||
enableSaveLastData && currentPage == 0 && currentList.isNotEmpty;
|
||||
if (shouldSaveLast && currentList.length > 500) {
|
||||
currentList = currentList.sublist(0, 50);
|
||||
currentList.removeRange(50, currentList.length);
|
||||
}
|
||||
lastRefreshAt = shouldSaveLast && savedRcmdTip ? dataList.length : null;
|
||||
return shouldSaveLast ? dataList + currentList : null;
|
||||
return shouldSaveLast ? (dataList..addAll(currentList)) : null;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user