e621: avoid race condition where we look too soon for avatars to fetch
This commit is contained in:
parent
b4ace0c52d
commit
951987e2bc
1 changed files with 3 additions and 0 deletions
|
@ -150,6 +150,9 @@ const augment_results = (container, posts, link_params) => {
|
|||
}
|
||||
|
||||
// fetch avatars and thumbnails in comments blocked by global blacklist
|
||||
while (document.querySelector('.post-thumb.placeholder')) {
|
||||
await new Promise(res => setTimeout(res, 100));
|
||||
}
|
||||
for (const el of document.querySelectorAll('.post-thumbnail[data-status=active] img[src^="/images/"]')) {
|
||||
el.src = get_preview_url((await make_request(`/posts/${el.closest('.post-thumbnail').dataset.id}.json`)).post);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue