mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
hub/sagas: fix handleDownloadAndRun slicing
Some of the math was assuming i was incremented with ++ instead += chunkSize.
This commit is contained in:
committed by
David Lechner
parent
960a3163ed
commit
06b204dd53
+2
-4
@@ -247,12 +247,10 @@ function* handleDownloadAndRun(action: ReturnType<typeof downloadAndRun>): Gener
|
||||
const writeUserRamMessageId = nextMessageId();
|
||||
|
||||
const data = yield* call(() =>
|
||||
didCompile.file.slice(i * chunkSize, (i + 1) * chunkSize).arrayBuffer(),
|
||||
didCompile.file.slice(i, i + chunkSize).arrayBuffer(),
|
||||
);
|
||||
|
||||
yield* put(
|
||||
sendWriteUserRamCommand(writeUserRamMessageId, i * chunkSize, data),
|
||||
);
|
||||
yield* put(sendWriteUserRamCommand(writeUserRamMessageId, i, data));
|
||||
|
||||
const { didFailToSend } = yield* race({
|
||||
didSend: take(
|
||||
|
||||
Reference in New Issue
Block a user