diff --git a/packages/doceditor/src/app/(root)/page.tsx b/packages/doceditor/src/app/(root)/page.tsx index c7652637a4..553af8bbe3 100644 --- a/packages/doceditor/src/app/(root)/page.tsx +++ b/packages/doceditor/src/app/(root)/page.tsx @@ -24,16 +24,17 @@ // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -import type { Metadata } from "next"; import { headers } from "next/headers"; +import Script from "next/script"; import { getSelectorsByUserAgent } from "react-device-detect"; +import { ValidationStatus } from "@docspace/shared/enums"; + import { getData, validatePublicRoomKey } from "@/utils/actions"; import { RootPageProps } from "@/types"; import Root from "@/components/Root"; import FilePassword from "@/components/file-password"; -import { ValidationStatus } from "@docspace/shared/enums"; const initialSearchParams: RootPageProps["searchParams"] = { fileId: undefined, @@ -71,8 +72,6 @@ async function Page({ searchParams }: RootPageProps) { } } - const startDate = new Date(); - const data = await getData( fileId ?? fileid ?? "", version, @@ -82,13 +81,22 @@ async function Page({ searchParams }: RootPageProps) { type, ); - const timer = new Date().getTime() - startDate.getTime(); - if (data.error?.status === "not-found" && error) { data.error.message = error; } - return ; + let url = data.config?.editorUrl ?? data.error?.editorUrl; + + if (url && !url.endsWith("/")) url += "/"; + + const docApiUrl = `${url}web-apps/apps/api/documents/api.js`; + + return ( + <> + +