Avoid search cache loading flicker
This commit is contained in:
@@ -83,7 +83,7 @@ export function SearchPanel({
|
||||
const cachedTags = readJSONCache<PostListResponse>(tagsUrl);
|
||||
if (cachedTags) setTags(extractTags(itemsOrEmpty(cachedTags.items)));
|
||||
|
||||
setIsTagLoading(true);
|
||||
setIsTagLoading(!cachedTags);
|
||||
getJSON<PostListResponse>(tagsUrl)
|
||||
.then((res) => {
|
||||
if (cancelled) return;
|
||||
@@ -118,7 +118,7 @@ export function SearchPanel({
|
||||
);
|
||||
}
|
||||
|
||||
setIsPostLoading(true);
|
||||
setIsPostLoading(!cachedPosts);
|
||||
getJSON<PostListResponse>(searchUrl)
|
||||
.then((res) => {
|
||||
const exactMatches = itemsOrEmpty(res.items).filter((post) =>
|
||||
|
||||
Reference in New Issue
Block a user