chore: add extra check to fetch pages list and page details (#4945)
This commit is contained in:
parent
4452630b33
commit
eda1599c0d
2 changed files with 6 additions and 4 deletions
|
|
@ -26,8 +26,10 @@ const PageDetailsPage = observer(() => {
|
||||||
|
|
||||||
// fetch page details
|
// fetch page details
|
||||||
const { error: pageDetailsError } = useSWR(
|
const { error: pageDetailsError } = useSWR(
|
||||||
pageId ? `PAGE_DETAILS_${pageId}` : null,
|
workspaceSlug && projectId && pageId ? `PAGE_DETAILS_${pageId}` : null,
|
||||||
pageId ? () => getPageById(workspaceSlug?.toString(), projectId?.toString(), pageId.toString()) : null,
|
workspaceSlug && projectId && pageId
|
||||||
|
? () => getPageById(workspaceSlug?.toString(), projectId?.toString(), pageId.toString())
|
||||||
|
: null,
|
||||||
{
|
{
|
||||||
revalidateIfStale: false,
|
revalidateIfStale: false,
|
||||||
revalidateOnFocus: false,
|
revalidateOnFocus: false,
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ export const PagesListView: React.FC<TPageView> = observer((props) => {
|
||||||
const { isAnyPageAvailable, getAllPages } = useProjectPages();
|
const { isAnyPageAvailable, getAllPages } = useProjectPages();
|
||||||
// fetching pages list
|
// fetching pages list
|
||||||
useSWR(
|
useSWR(
|
||||||
projectId ? `PROJECT_PAGES_${projectId}` : null,
|
workspaceSlug && projectId && pageType ? `PROJECT_PAGES_${projectId}` : null,
|
||||||
projectId ? () => getAllPages(workspaceSlug, projectId, pageType) : null
|
workspaceSlug && projectId && pageType ? () => getAllPages(workspaceSlug, projectId, pageType) : null
|
||||||
);
|
);
|
||||||
|
|
||||||
// pages loader
|
// pages loader
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue