2019-03-28 16:22:17 +00:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2019-2024 New Vector Ltd.
|
2019-03-28 16:22:17 +00:00
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2019-03-28 16:22:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
2021-10-22 17:23:32 -05:00
|
|
|
|
2019-03-28 16:22:17 +00:00
|
|
|
import SdkConfig from "../../../SdkConfig";
|
|
|
|
|
import Modal from "../../../Modal";
|
|
|
|
|
import { _t } from "../../../languageHandler";
|
2021-09-05 10:53:57 +02:00
|
|
|
import BaseDialog from "./BaseDialog";
|
|
|
|
|
import DialogButtons from "../elements/DialogButtons";
|
|
|
|
|
import BugReportDialog from "./BugReportDialog";
|
2023-05-12 09:49:37 +01:00
|
|
|
import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton";
|
2021-09-05 10:53:57 +02:00
|
|
|
|
2023-02-28 10:31:48 +00:00
|
|
|
interface IProps {
|
|
|
|
|
onFinished(signOut?: boolean): void;
|
|
|
|
|
}
|
2019-03-28 16:22:17 +00:00
|
|
|
|
2021-09-05 10:53:57 +02:00
|
|
|
export default class StorageEvictedDialog extends React.Component<IProps> {
|
2023-05-12 09:49:37 +01:00
|
|
|
private sendBugReport = (ev: ButtonEvent): void => {
|
2019-03-28 16:22:17 +00:00
|
|
|
ev.preventDefault();
|
2022-06-14 17:51:51 +01:00
|
|
|
Modal.createDialog(BugReportDialog, {});
|
2019-03-28 16:22:17 +00:00
|
|
|
};
|
|
|
|
|
|
2021-09-05 10:53:57 +02:00
|
|
|
private onSignOutClick = (): void => {
|
2019-03-28 16:22:17 +00:00
|
|
|
this.props.onFinished(true);
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-13 17:01:43 +00:00
|
|
|
public render(): React.ReactNode {
|
2019-03-28 16:22:17 +00:00
|
|
|
let logRequest;
|
|
|
|
|
if (SdkConfig.get().bug_report_endpoint_url) {
|
|
|
|
|
logRequest = _t(
|
2023-10-03 19:17:26 +01:00
|
|
|
"bug_reporting|log_request",
|
2021-04-29 19:57:02 +02:00
|
|
|
{},
|
2021-04-27 17:23:27 +02:00
|
|
|
{
|
2022-01-07 10:40:53 +01:00
|
|
|
a: (text) => (
|
|
|
|
|
<AccessibleButton kind="link_inline" onClick={this.sendBugReport}>
|
|
|
|
|
{text}
|
|
|
|
|
</AccessibleButton>
|
|
|
|
|
),
|
2021-04-27 17:23:27 +02:00
|
|
|
},
|
|
|
|
|
);
|
2019-03-28 16:22:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
2021-07-23 10:23:45 +01:00
|
|
|
<BaseDialog
|
|
|
|
|
className="mx_ErrorDialog"
|
|
|
|
|
onFinished={this.props.onFinished}
|
2023-10-03 19:17:26 +01:00
|
|
|
title={_t("error|storage_evicted_title")}
|
2019-03-28 16:22:17 +00:00
|
|
|
contentId="mx_Dialog_content"
|
|
|
|
|
hasCancel={false}
|
|
|
|
|
>
|
|
|
|
|
<div className="mx_Dialog_content" id="mx_Dialog_content">
|
2023-10-03 19:17:26 +01:00
|
|
|
<p>{_t("error|storage_evicted_description_1")}</p>
|
2021-07-19 22:43:11 +01:00
|
|
|
<p>
|
2023-10-03 19:17:26 +01:00
|
|
|
{_t("error|storage_evicted_description_2")} {logRequest}
|
2021-07-19 22:43:11 +01:00
|
|
|
</p>
|
2019-03-28 16:22:17 +00:00
|
|
|
</div>
|
|
|
|
|
<DialogButtons
|
2023-08-23 11:57:22 +01:00
|
|
|
primaryButton={_t("action|sign_out")}
|
2021-09-05 10:53:57 +02:00
|
|
|
onPrimaryButtonClick={this.onSignOutClick}
|
2019-03-28 16:22:17 +00:00
|
|
|
focus={true}
|
|
|
|
|
hasCancel={false}
|
|
|
|
|
/>
|
|
|
|
|
</BaseDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|