apply correct amount of deltas from a search result

This commit is contained in:
Nikita Galaiko 2023-03-17 15:39:19 +01:00
parent cd6afbb9e9
commit fbf05e842a

View File

@ -39,7 +39,9 @@
const { sessionId, projectId, filePath } = result;
const [doc, deltas] = await Promise.all([
listFiles({ projectId, sessionId, paths: [filePath] }).then((r) => r[filePath] ?? ''),
listDeltas({ projectId, sessionId, paths: [filePath] }).then((r) => r[filePath] ?? [])
listDeltas({ projectId, sessionId, paths: [filePath] })
.then((r) => r[filePath] ?? [])
.then((d) => d.slice(0, result.index + 1))
]);
processedResults = [
...processedResults,