-
Notifications
You must be signed in to change notification settings - Fork 12
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
explorer fetch function refactored #2704
base: master
Are you sure you want to change the base?
Conversation
async function setInsightItems() { | ||
if (activeMenu !== MenuItem.TRENDING) return | ||
const insightItems = await queryExplorerItems({ | ||
types: [EntityKeys.INSIGHT], | ||
page: insightsPage, | ||
}) | ||
insightsPages = insightItems.pages | ||
insights = insightsPage === 1 ? insightItems.items : insights.concat(insightItems.items) | ||
} | ||
|
||
async function setDisplayingItems() { | ||
const displayingItems = await queryExplorerItems({ |
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.
As @Woafflation described, separate insights' query was added as hotfix to support insights in the feed. Now it is not required, since it's natively supported by the api.
app/src/pages/Explorer/Category/ExplorerCategory.svelte
Lines 91 to 104 in b5b94db
queryExplorerItems({ | |
types: [EntityKeys.INSIGHT], | |
page: insightsPage, | |
}) | |
.then((res) => { | |
if (activeMenu === MenuItem.TRENDING) { | |
insightsPages = res.pages | |
insights = insightsPage === 1 ? res.items : insights.concat(res.items) | |
} | |
}) | |
.catch(() => notifyError({ user: $currentUser })) | |
.finally(() => { | |
queryExplorerItems({ | |
types: getDisplayingType(displayingTypes), |
The inisght specific query function can be removed (LOC 82)
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.
I will merge this PR a little bit later
Changes
Notion's card
Checklist
Screenshots or GIFs