Skip to content

hasMore false after add #1

@grydstedt

Description

@grydstedt

Hey, thanks for this useful hook.

I noticed when I do an add the hasMore is set to false.

 const {items, loading, loadingMore, hasMore, loadMore} = usePagination(
    app
      .firestore()
      .collection(CHAT_COLLECTION)
      .where('room', '==', roomId)
      .orderBy('created', 'desc'),
    {
      limit: MAX_LIMIT
    }
  );

then later:

        app
          .firestore()
          .collection(CHAT_COLLECTION)
          .add({
            id: random(),
            message,
            from: userId,
            created: new Date(),
            room: roomId
          });

After the add, hasMore is set to false even though there are more documents in the collection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions