-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mailbox] Implemented server-side pagination #217
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nylas/components/72LUW9NxoJ5gP8ELXGu12EDFGg12 |
This pull request has been linked to Shortcut Story #74056: Mailbox component - unable to page past initial threads. |
const queryKey = JSON.stringify(query); | ||
if (!threadsMap[queryKey] && (query.component_id || query.access_token)) { | ||
threadsMap[queryKey] = [await fetchThread(query)]; | ||
updateThreadSelection: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO - revisit if this is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
if (_this.all_threads) { | ||
threads = _this.all_threads as Thread[]; | ||
if (_this.all_threads || !id) { | ||
threads = (_this.all_threads as Thread[]) ?? []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO - paginate onmount
23ce5ec
to
aa001be
Compare
aa001be
to
476ec97
Compare
476ec97
to
d685056
Compare
} else { | ||
threads = (await MailboxStore.getThreads(query)) || []; | ||
} | ||
await updatedDisplayedThreads(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updatedDisplayedThreads
did you mean updateDisplayedThreads
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch, not sure how this isn't causing any errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see, it's like this everywhere - needs to be renamed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏽
d685056
to
be1b155
Compare
Code changes
unread_status
prop from Mailboxunread
prop from EmailLicense
I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.