There was an error while loading. Please reload this page.
1 parent 3215ea5 commit 55167c8Copy full SHA for 55167c8
1 file changed
web/src/lib/diff-viewer-multi-file.svelte.ts
@@ -505,17 +505,18 @@ export class MultiFileDiffViewerState {
505
506
// Load patches
507
const tempDetails: FileDetails[] = [];
508
- let lastYield = Date.now();
+ let lastYield = performance.now();
509
for await (const details of generator) {
510
this.loadingState.loadedCount++;
511
512
// Pushing directly to the main array causes too many signals to update (lag)
513
tempDetails.push(details);
514
515
- if (Date.now() - lastYield > 50) {
+ const now = performance.now();
516
+ if (now - lastYield > 50) {
517
await tick();
518
await animationFramePromise();
- lastYield = Date.now();
519
+ lastYield = now;
520
}
521
522
if (tempDetails.length === 0) {
0 commit comments