From 1b3c7f0f79478106b98101a2b9e7fce88575f186 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Sun, 7 Apr 2024 00:01:40 +0700 Subject: [PATCH] Fix file retrieval and readme loading in RootPage --- src/app/actions.ts | 1 + src/app/page.tsx | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/actions.ts b/src/app/actions.ts index ffcc2d8..9a4ddd8 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -336,6 +336,7 @@ export async function GetFiles({ let decryptedId: string | undefined; if (id) decryptedId = await decryptData(id); else decryptedId = await decryptData(config.apiConfig.rootFolder); + const filterName = config.apiConfig.hiddenFiles .map((item) => `not name = '${item}'`) .join(" and "); diff --git a/src/app/page.tsx b/src/app/page.tsx index 0e47406..3cd1812 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,18 +7,16 @@ import FileBrowser from "./@explorer"; import Header from "./@header"; import HeaderButton from "./@header.button"; import Markdown from "./@markdown"; -import { GetFiles } from "./actions"; +import { GetFiles, GetReadme } from "./actions"; export const revalidate = 300; export const dynamic = "force-dynamic"; export default async function RootPage() { - const data = await GetFiles({}); - const readme = ""; - // const [data, readme] = await Promise.all([ - // GetFiles({}), - // GetReadme(undefined), - // ]); + const [data, readme] = await Promise.all([ + GetFiles({}), + GetReadme(undefined), + ]); return (