use fire immediatialy
This commit is contained in:
@@ -13,21 +13,25 @@ class CompletePageInfo extends _$CompletePageInfo {
|
||||
return AsyncData(cached!);
|
||||
}
|
||||
|
||||
ref.listen(pageInfoProvider(url, isImageRequest: false), (previous, next) {
|
||||
if (cached != null && next.hasValue) {
|
||||
state = AsyncData(
|
||||
WebPageInfo(
|
||||
url: url,
|
||||
//Cached is preferred as this comes from gecko and is more likely to be correct compared to manual request
|
||||
favicon: cached.favicon ?? next.value!.favicon,
|
||||
feeds: cached.feeds ?? next.value!.feeds,
|
||||
title: cached.title ?? next.value!.title,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
state = next;
|
||||
}
|
||||
});
|
||||
ref.listen(
|
||||
fireImmediately: true,
|
||||
pageInfoProvider(url, isImageRequest: false),
|
||||
(previous, next) {
|
||||
if (cached != null && next.hasValue) {
|
||||
state = AsyncData(
|
||||
WebPageInfo(
|
||||
url: url,
|
||||
//Cached is preferred as this comes from gecko and is more likely to be correct compared to manual request
|
||||
favicon: cached.favicon ?? next.value!.favicon,
|
||||
feeds: cached.feeds ?? next.value!.feeds,
|
||||
title: cached.title ?? next.value!.title,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
state = next;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return (cached != null) ? AsyncData(cached) : const AsyncLoading();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user