From 77a15338eacd527f54d449125903b1ad61a3fb8d Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Sat, 27 Nov 2021 08:04:58 +0100
Subject: [PATCH] Fix bad ssl certificate even in release mode...; Search non
 case sensitive for username

---
 lib/main.dart          | 4 ++--
 lib/models/search.dart | 6 ++++--
 pubspec.yaml           | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/main.dart b/lib/main.dart
index b187bfb9..39ed3d71 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -79,6 +79,8 @@ Future<void> main() async {
   //   _homeProvider.playSound('start', 0.2);
   // }
 
+  HttpOverrides.global = MyHttpOverrides();
+
   if (kReleaseMode && enableSentry) {
     // CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
     //   SentryHandler(SentryClient(SentryOptions(
@@ -110,8 +112,6 @@ Future<void> main() async {
   } else {
     print('Debug mode enabled: No sentry alerte');
 
-    HttpOverrides.global = MyHttpOverrides();
-
     runApp(Gecko(endPointGVA));
   }
 }
diff --git a/lib/models/search.dart b/lib/models/search.dart
index 6718130f..67429663 100644
--- a/lib/models/search.dart
+++ b/lib/models/search.dart
@@ -8,7 +8,7 @@ import 'package:http/http.dart' as http;
 class SearchProvider with ChangeNotifier {
   TextEditingController searchController = TextEditingController();
   List searchResult = [];
-  final cacheDuring = 0 * 60 * 1000; //First number is minutes
+  final cacheDuring = 20 * 60 * 1000; //First number is minutes
   int cacheTime = 0;
 
   void rebuildWidget() {
@@ -33,7 +33,9 @@ class SearchProvider with ChangeNotifier {
     g1WalletsBox.toMap().forEach((key, value) {
       if ((value.id != null &&
               value.id.username != null &&
-              value.id.username.contains(searchController.text)) ||
+              value.id.username
+                  .toLowerCase()
+                  .contains(searchController.text)) ||
           value.pubkey.contains(searchController.text)) {
         searchResult.add(value);
         return;
diff --git a/pubspec.yaml b/pubspec.yaml
index 38f91844..b8c46929 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -5,7 +5,7 @@ description: Pay with G1.
 # pub.dev using `pub publish`. This is preferred for private packages.
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 
-version: 0.0.3+6
+version: 0.0.3+7
 
 environment:
   sdk: ">=2.7.0 <3.0.0"
-- 
GitLab