chore: add extra check to fetch pages list and page details (#4945)

This commit is contained in:
Aaryan Khandelwal 2024-06-26 18:49:13 +05:30 committed by GitHub
parent 4452630b33
commit eda1599c0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -26,8 +26,10 @@ const PageDetailsPage = observer(() => {
// fetch page details
const { error: pageDetailsError } = useSWR(
pageId ? `PAGE_DETAILS_${pageId}` : null,
pageId ? () => getPageById(workspaceSlug?.toString(), projectId?.toString(), pageId.toString()) : null,
workspaceSlug && projectId && pageId ? `PAGE_DETAILS_${pageId}` : null,
workspaceSlug && projectId && pageId
? () => getPageById(workspaceSlug?.toString(), projectId?.toString(), pageId.toString())
: null,
{
revalidateIfStale: false,
revalidateOnFocus: false,