Doceditor: fix iphone problems
This commit is contained in:
parent
d84a4b3bef
commit
eebbb68734
@ -48,6 +48,7 @@ const Root = ({
|
||||
isSharingAccess,
|
||||
editorUrl,
|
||||
doc,
|
||||
fileId,
|
||||
}: TResponse) => {
|
||||
const documentserverUrl = editorUrl?.docServiceUrl;
|
||||
const fileInfo = config?.file;
|
||||
@ -121,7 +122,7 @@ const Root = ({
|
||||
i18n={i18n}
|
||||
onError={onError}
|
||||
>
|
||||
{!fileInfo?.id ? (
|
||||
{!fileId ? (
|
||||
<AppLoader />
|
||||
) : isShowDeepLink ? (
|
||||
<DeepLink
|
||||
@ -139,8 +140,8 @@ const Root = ({
|
||||
customizedBodyText={getErrorMessage()}
|
||||
isEditor
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
) : isShowDeepLink ? null : (
|
||||
<div style={{ width: "100%", height: "100%" }}>
|
||||
{config && user && documentserverUrl && fileInfo && (
|
||||
<Editor
|
||||
config={config}
|
||||
@ -196,7 +197,7 @@ const Root = ({
|
||||
i18n={i18n}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
</ErrorBoundary>
|
||||
</ThemeProvider>
|
||||
|
@ -16,6 +16,7 @@ const useError = ({ error, editorUrl, t }: UseErrorProps) => {
|
||||
React.useEffect(() => {
|
||||
if (error?.message === "unauthorized") {
|
||||
sessionStorage.setItem("referenceUrl", window.location.href);
|
||||
|
||||
window.open(
|
||||
combineUrl(window.DocSpaceConfig?.proxy?.url, "/login"),
|
||||
"_self",
|
||||
|
@ -16,8 +16,7 @@ import { TSelectedFileInfo } from "@docspace/shared/selectors/Files/FilesSelecto
|
||||
import SocketIOHelper from "@docspace/shared/utils/socket";
|
||||
import { FilesSelectorFilterTypes } from "@docspace/shared/enums";
|
||||
import { TRoomSecurity } from "@docspace/shared/api/rooms/types";
|
||||
import { Nullable, TPathParts, TTranslation } from "@docspace/shared/types";
|
||||
import { TTheme } from "@docspace/shared/themes";
|
||||
import { Nullable, TTranslation } from "@docspace/shared/types";
|
||||
import { i18n } from "i18next";
|
||||
|
||||
export type TGoBack = {
|
||||
@ -158,6 +157,7 @@ export type TResponse =
|
||||
isSharingAccess: boolean;
|
||||
error?: TError;
|
||||
doc?: string;
|
||||
fileId?: string;
|
||||
}
|
||||
| {
|
||||
error: TError;
|
||||
@ -168,6 +168,7 @@ export type TResponse =
|
||||
successAuth?: undefined;
|
||||
isSharingAccess?: undefined;
|
||||
doc?: undefined;
|
||||
fileId?: string;
|
||||
};
|
||||
|
||||
export type EditorProps = {
|
||||
|
@ -79,6 +79,7 @@ export async function getData(
|
||||
successAuth: false,
|
||||
isSharingAccess: false,
|
||||
doc,
|
||||
fileId,
|
||||
};
|
||||
|
||||
// needed to reset rtl language in Editor
|
||||
@ -110,7 +111,7 @@ export async function getData(
|
||||
return response;
|
||||
}
|
||||
|
||||
const response: TResponse = { error: { message: "unauthorized" } };
|
||||
const response: TResponse = { error: { message: "unauthorized" }, fileId };
|
||||
|
||||
return response;
|
||||
} catch (e) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { ErrorInfo } from "react";
|
||||
import { ThemeProvider } from "styled-components";
|
||||
|
||||
import { I18nextProvider } from "react-i18next";
|
||||
|
||||
import Error520 from "../errors/Error520";
|
||||
@ -27,7 +27,6 @@ class ErrorBoundary extends React.Component<
|
||||
// You can also log the error to an error reporting service
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error, errorInfo);
|
||||
|
||||
const { onError } = this.props;
|
||||
|
||||
onError?.();
|
||||
@ -53,19 +52,17 @@ class ErrorBoundary extends React.Component<
|
||||
|
||||
if (isNextJS && theme && i18n) {
|
||||
return (
|
||||
<ThemeProvider theme={theme}>
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<Error520
|
||||
user={user}
|
||||
errorLog={error}
|
||||
version={version}
|
||||
firebaseHelper={firebaseHelper}
|
||||
currentDeviceType={currentDeviceType}
|
||||
whiteLabelLogoUrls={whiteLabelLogoUrls}
|
||||
currentColorScheme={theme.currentColorScheme}
|
||||
/>
|
||||
</I18nextProvider>
|
||||
</ThemeProvider>
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<Error520
|
||||
user={user}
|
||||
errorLog={error}
|
||||
version={version}
|
||||
firebaseHelper={firebaseHelper}
|
||||
currentDeviceType={currentDeviceType}
|
||||
whiteLabelLogoUrls={whiteLabelLogoUrls}
|
||||
currentColorScheme={theme.currentColorScheme}
|
||||
/>
|
||||
</I18nextProvider>
|
||||
);
|
||||
}
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user