Skip to content

Commit

Permalink
Merge pull request #2680 from daostack/feature/extend-searching-limits
Browse files Browse the repository at this point in the history
Increase fetch bulks on Search
  • Loading branch information
andreymikhadyuk authored Apr 11, 2024
2 parents 19679e8 + 59844ec commit ba43d75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/store/states/inbox/saga/getInboxItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { User } from "@/shared/models";
import { isError } from "@/shared/utils";
import * as actions from "../actions";
import { selectInboxItems } from "../selectors";
import { selectInboxItems, selectInboxSearchValue } from "../selectors";
import { InboxItems } from "../types";
import { getFeedLayoutItemDateForSorting } from "../utils";
import { searchFetchedInboxItems } from "./searchFetchedInboxItems";
Expand Down Expand Up @@ -40,6 +40,7 @@ export function* getInboxItems(
throw new Error("There is no user for inbox items fetch");
}

const searchValue: string = yield select(selectInboxSearchValue);
const currentItems = (yield select(selectInboxItems)) as InboxItems;
const isFirstRequest = !currentItems.lastDocTimestamp;

Expand All @@ -52,7 +53,7 @@ export function* getInboxItems(
{
userId: user.uid,
startAfter: currentItems.lastDocTimestamp,
limit,
limit: searchValue ? 500 : limit,
unread,
},
)) as Awaited<ReturnType<typeof UserService.getInboxItemsWithMetadata>>;
Expand Down

0 comments on commit ba43d75

Please sign in to comment.