[FIX] Ensure all vocab data always written to db
This commit is contained in:
@@ -272,9 +272,11 @@ exports.createProgress = functions.https.onCall((data, context) => {
|
||||
progressDocId.collection("definitions").doc(vocabId),
|
||||
definitions
|
||||
);
|
||||
}
|
||||
|
||||
if (mode == "questions" && index >= limit - 1) {
|
||||
if ((mode == "questions" && index >= limit - 1) || index === array.length - 1) {
|
||||
array.length = index + 1;
|
||||
batch.commit();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user