mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: use cascade (#812)
This commit is contained in:
committed by
GitHub
parent
877732e1e7
commit
6f69a45195
@@ -85,8 +85,7 @@ class WhisperController
|
||||
if (isRefresh) {
|
||||
loadingState.value = LoadingState<List<SessionList>?>.success(dataList);
|
||||
} else if (loadingState.value is Success) {
|
||||
List<SessionList> list = (loadingState.value as Success).response;
|
||||
list.addAll(dataList);
|
||||
loadingState.value.data!.addAll(dataList);
|
||||
loadingState.refresh();
|
||||
}
|
||||
});
|
||||
@@ -103,8 +102,7 @@ class WhisperController
|
||||
Future onRemove(int index, int? talkerId) async {
|
||||
var res = await MsgHttp.removeMsg(talkerId);
|
||||
if (res['status']) {
|
||||
List<SessionList> list = (loadingState.value as Success).response;
|
||||
list.removeAt(index);
|
||||
loadingState.value.data!.removeAt(index);
|
||||
loadingState.refresh();
|
||||
SmartDialog.showToast('删除成功');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user