mounted check
This commit is contained in:
@@ -346,59 +346,23 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
|||||||
return cachedIcon;
|
return cachedIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: only_use_keep_alive_inside_keep_alive
|
if (ref.mounted) {
|
||||||
final result = await ref.read(
|
// ignore: only_use_keep_alive_inside_keep_alive
|
||||||
pageInfoProvider(url, isImageRequest: true).future,
|
final result = await ref.read(
|
||||||
);
|
pageInfoProvider(url, isImageRequest: true).future,
|
||||||
|
);
|
||||||
|
|
||||||
if (result.favicon case final BrowserIcon favicon) {
|
if (result.favicon case final BrowserIcon favicon) {
|
||||||
//If it was a `isImageRequest` hit, we need to cache it at this point
|
//If it was a `isImageRequest` hit, we need to cache it at this point
|
||||||
if (!_browserIconCache.contains(url.origin)) {
|
if (!_browserIconCache.contains(url.origin)) {
|
||||||
_browserIconCache.set(url.origin, favicon);
|
_browserIconCache.set(url.origin, favicon);
|
||||||
|
}
|
||||||
|
|
||||||
|
return favicon;
|
||||||
}
|
}
|
||||||
|
|
||||||
return favicon;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<Uri?> tryUpgradeToHttps(Uri httpUri) async {
|
|
||||||
// if (httpUri.isScheme('https')) {
|
|
||||||
// return httpUri;
|
|
||||||
// } else if (httpUri.isScheme('http')) {
|
|
||||||
// final cached = _httpsCache[httpUri.host];
|
|
||||||
// if (cached != null) {
|
|
||||||
// return cached ? httpUri.replace(scheme: 'https') : null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var sslAvailable = false;
|
|
||||||
|
|
||||||
// try {
|
|
||||||
// final context = SecurityContext.defaultContext;
|
|
||||||
|
|
||||||
// final socket = await SecureSocket.connect(
|
|
||||||
// httpUri.host,
|
|
||||||
// 443,
|
|
||||||
// context: context,
|
|
||||||
// timeout: const Duration(seconds: 3),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// await socket.close();
|
|
||||||
|
|
||||||
// sslAvailable = true;
|
|
||||||
// } catch (_) {
|
|
||||||
// sslAvailable = false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _httpsCache[httpUri.host] = sslAvailable;
|
|
||||||
|
|
||||||
// if (sslAvailable) {
|
|
||||||
// return httpUri.replace(scheme: 'https');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ final class GenericWebsiteServiceProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _$genericWebsiteServiceHash() =>
|
String _$genericWebsiteServiceHash() =>
|
||||||
r'c20897405a4d31983a22d61e955ffb7430d06a54';
|
r'9bc32261abd76a79efb57f6d27832e949cb495a6';
|
||||||
|
|
||||||
abstract class _$GenericWebsiteService extends $Notifier<void> {
|
abstract class _$GenericWebsiteService extends $Notifier<void> {
|
||||||
void build();
|
void build();
|
||||||
|
|||||||
Reference in New Issue
Block a user