mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix incorrect message counter
This commit is contained in:
@@ -615,7 +615,7 @@ router.post('/search', jsonParser, function (request, response) {
|
|||||||
const data = fs.readFileSync(chatFile.path, 'utf8');
|
const data = fs.readFileSync(chatFile.path, 'utf8');
|
||||||
const messages = data.split('\n')
|
const messages = data.split('\n')
|
||||||
.map(line => { try { return JSON.parse(line); } catch (_) { return null; } })
|
.map(line => { try { return JSON.parse(line); } catch (_) { return null; } })
|
||||||
.filter(x => x);
|
.filter(x => x && typeof x.mes === 'string');
|
||||||
|
|
||||||
if (messages.length === 0) {
|
if (messages.length === 0) {
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user