Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
fix: index issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Ratiashvili committed Dec 8, 2021
1 parent c950fd4 commit f992b70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Encoder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ const encode = async () => {
const parts = stringToChunks(compressedPayload, CHUNK_SIZE);
await addLog(`Chunks before: ${parts.length}`);
setGifProgress(5);
const chunks = solmonReedChunks(parts, { blocksCount, extraBlocksCount });
const chunks = solmonReedChunks(parts, { blocksCount, extraBlocksCount }).map(
(chunk, index) => ({ chunk, index })
);
await addLog(`Chunks count ${chunks.length}`);
await addLog(`Creating qrs...`);
setGifProgress(10);
Expand Down Expand Up @@ -232,7 +234,7 @@ const encode = async () => {
});
encoder.setDelay(frameDuration * 1000);
await Promise.all(
fileredChunks.map((chunk, index) => {
fileredChunks.map(({ chunk, index }) => {
return createQR(chunk, {
index: index,
total: chunks.length,
Expand Down

0 comments on commit f992b70

Please sign in to comment.