Fix the end condition for the embed content handling loop (#1824)

Co-authored-by: Koy Zhuang <koy@ko8e24.top>
This commit is contained in:
Julien Wajsberg 2023-05-18 08:13:56 +02:00 committed by GitHub
parent 84ac82da8f
commit 3fbb9b299a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ const cached = {};
function walkFetchEmbed({ embedTokens, compile, fetch }, cb) {
let token;
let step = 0;
let count = 1;
let count = 0;
if (!embedTokens.length) {
return cb({});
@ -73,7 +73,7 @@ function walkFetchEmbed({ embedTokens, compile, fetch }, cb) {
}
cb({ token, embedToken });
if (++count >= step) {
if (++count >= embedTokens.length) {
cb({});
}
};