Activity order unqiue in elastic (#4291)

This commit is contained in:
Vyacheslav Tumanov 2024-01-03 20:30:53 +05:00 committed by GitHub
parent b782769647
commit e6e53e3231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@
let messages: ChatMessage[] = []
let activityOrderNewestFirst = JSON.parse(localStorage.getItem('activity-newest-first') ?? 'false')
$: localStorage.setItem('activity-newest-first', JSON.stringify(activityOrderNewestFirst))
$: query.query(
chunter.class.ChatMessage,
{ attachedTo: objectId },

View File

@ -305,7 +305,7 @@ function updateDoc2Elastic (
doc[docIdAttr] = typeof doc[docIdAttr] === 'string' ? [doc[docIdAttr]] : [...(doc[docIdAttr] ?? [])]
if (vv !== '') {
if (typeof vv !== 'object') {
doc[docIdAttr].push(vv)
doc[docIdAttr] = Array.from(new Set([...doc[docIdAttr], vv]))
}
}
}