Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix: sorted entities reactivity (#93)

gbirman5ddd33c9ca9f
diff --git a/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx b/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx
index 9b62c32424..d4576d19d7 100644
--- a/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx
+++ b/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx
@@ -270,7 +270,7 @@ export function createUnifiedInfiniteList<T extends EntityData>({
let noResultsTimeoutId: ReturnType<typeof setTimeout> | undefined;
createEffect(
on(
- [() => sortedEntitiesStore.length, debouncedIsLoading],
+ [() => sortedEntities().length, debouncedIsLoading],
([entitiesLength, loading]) => {
if (noResultsTimeoutId) clearTimeout(noResultsTimeoutId);
@@ -364,7 +364,7 @@ export function createUnifiedInfiniteList<T extends EntityData>({
// because it's possible that the match exists on the server
createEffect(
on(
- [() => sortedEntitiesStore, viewportItemCount, loadingCount],
+ [sortedEntities, viewportItemCount, loadingCount],
([sortedEntities, viewportItemCount, loadingCount]) => {
if (sortedEntities.length >= viewportItemCount) return;
if (loadingCount > 0) return;
@@ -412,9 +412,7 @@ export function createUnifiedInfiniteList<T extends EntityData>({
{(entity, index) => {
if (
untrack(index) ===
- Math.floor(
- untrack(() => sortedEntitiesStore).length * 0.9
- )
+ Math.floor(untrack(sortedEntities).length * 0.9)
)
debouncedFetchMore();
return <EntityRenderer entity={entity} index={index()} />;