Skip to content

Commit

Permalink
fix: 搜索出现重复的项
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaoMint committed Aug 10, 2023
1 parent 91d2e80 commit b80896f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/pages/search/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class SearchPageController extends GetxController {

Future<void> getResult(String key) async {
final futures = <Future>[];

for (var i = 0; i < searchResultList.length; i++) {
final element = searchResultList[i];
Future<List<ExtensionListItem>> resultFuture;
Expand All @@ -49,7 +48,7 @@ class SearchPageController extends GetxController {
}
element.result = result;
if (result.isNotEmpty) {
searchResultList.removeAt(i);
searchResultList.remove(element);
searchResultList.insert(0, element);
}
}).catchError((e) {
Expand Down

0 comments on commit b80896f

Please sign in to comment.