fix: thread is broken after deleted first generated message (#1061)

This commit is contained in:
Louis 2023-12-18 15:39:29 +07:00 committed by GitHub
parent 54f916d3fe
commit 80f953ba1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,7 @@ export default class JSONConversationalExtension
await fs.writeFile( await fs.writeFile(
threadMessagePath, threadMessagePath,
messages.map((msg) => JSON.stringify(msg)).join('\n') + messages.map((msg) => JSON.stringify(msg)).join('\n') +
(messages.length > 1 ? '\n' : '') (messages.length ? '\n' : '')
) )
Promise.resolve() Promise.resolve()
} catch (err) { } catch (err) {