mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-07 01:03:34 +02:00
Misc. bug bash
This commit is contained in:
@@ -174,7 +174,11 @@ export function SearchView({
|
||||
api
|
||||
.getMessages({ q: debouncedQuery, limit: SEARCH_PAGE_SIZE, offset }, controller.signal)
|
||||
.then((data) => {
|
||||
setResults((prev) => [...prev, ...(data as SearchResult[])]);
|
||||
setResults((prev) => {
|
||||
const existingIds = new Set(prev.map((r) => r.id));
|
||||
const unique = (data as SearchResult[]).filter((r) => !existingIds.has(r.id));
|
||||
return [...prev, ...unique];
|
||||
});
|
||||
setHasMore(data.length >= SEARCH_PAGE_SIZE);
|
||||
setOffset((prev) => prev + data.length);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user