Fix file retrieval and readme loading in RootPage

This commit is contained in:
mbaharip
2024-04-07 00:01:40 +07:00
parent ac52619532
commit 1b3c7f0f79
2 changed files with 6 additions and 7 deletions
+1
View File
@@ -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 ");
+5 -7
View File
@@ -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 (
<div className={cn("h-fit w-full", "flex flex-col gap-3")}>