Skip to content

Commit 77e8869

Browse files
authored
Don't lose threads with incremental updates. (#32)
1 parent c08c7da commit 77e8869

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

dist/index.js

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,13 @@ async function processGuild(guild: Guild): Promise<void> {
310310
}
311311
console.log(`Transcripts saved to: ${path.resolve(TRANSCRIPT_DIR)}`)
312312

313-
// Create the index.
313+
// Add the old index entries to the new index.
314+
for (const threadId in oldIndex) {
315+
if (!index[threadId]) {
316+
index[threadId] = oldIndex[threadId]
317+
}
318+
}
319+
314320
const sortedTranscriptEntries = Object.values(index).sort((a, b) => {
315321
// Sort by lastActivity timestamp (most recent first)
316322
// If no timestamp available, put at the bottom

0 commit comments

Comments
 (0)