mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 13:38:38 +00:00
Remove: redirect to password page
This commit is contained in:
@@ -38,8 +38,8 @@ function FileLayout({ data }: Props) {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const files = clientData.files.length;
|
||||
const folders = clientData.folders.length;
|
||||
const files = clientData.files.length ?? 0;
|
||||
const folders = clientData.folders.length ?? 0;
|
||||
setTotalItems(files + folders);
|
||||
}, [clientData]);
|
||||
|
||||
@@ -67,7 +67,9 @@ function FileLayout({ data }: Props) {
|
||||
return (
|
||||
<>
|
||||
{layout === "grid" ? (
|
||||
<GridLayout data={clientData} />
|
||||
<>
|
||||
<GridLayout data={clientData} />
|
||||
</>
|
||||
) : (
|
||||
<ListLayout data={clientData} />
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Metadata, ResolvingMetadata } from "next";
|
||||
import { cookies } from "next/headers";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
|
||||
import Breadcrumb from "components/compBreadcrumb";
|
||||
import FileLayout from "components/compFileLayout";
|
||||
@@ -121,19 +120,6 @@ async function FilePage({ params }: Props) {
|
||||
|
||||
if (!pathValidation.success) {
|
||||
const errorData = pathValidation as API_Error;
|
||||
if (errorData.code === 401) {
|
||||
const protectedPath = errorData.reason
|
||||
.split('"')[1]
|
||||
.split('"')[0];
|
||||
redirect(
|
||||
`/password?redirect=${params.path.join(
|
||||
"/",
|
||||
)}&path=${protectedPath}`,
|
||||
);
|
||||
}
|
||||
if (errorData.code === 404) {
|
||||
notFound();
|
||||
}
|
||||
const payload = handleError(errorData);
|
||||
throw new Error(payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user