Revert some changes due to failing tests

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-02 18:00:07 +02:00
parent 799d10b77e
commit dcb5557848
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
5 changed files with 19 additions and 8 deletions

View file

@ -16,11 +16,9 @@ limitations under the License.
import React, { ComponentType } from "react";
import * as sdk from './index';
import { _t } from './languageHandler';
import { IDialogProps } from "./components/views/dialogs/IDialogProps";
import BaseDialog from "./components/views/dialogs/BaseDialog";
import Spinner from "./components/views/elements/Spinner";
import DialogButtons from "./components/views/elements/DialogButtons";
type AsyncImport<T> = { default: T };
@ -79,6 +77,9 @@ export default class AsyncWrapper extends React.Component<IProps, IState> {
const Component = this.state.component;
return <Component {...this.props} />;
} else if (this.state.error) {
// FIXME: Using an import will result in test failures
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
return <BaseDialog onFinished={this.props.onFinished} title={_t("Error")}>
{ _t("Unable to load! Check your network connectivity and try again.") }
<DialogButtons primaryButton={_t("Dismiss")}
@ -88,6 +89,7 @@ export default class AsyncWrapper extends React.Component<IProps, IState> {
</BaseDialog>;
} else {
// show a spinner until the component is loaded.
const Spinner = sdk.getComponent("elements.Spinner");
return <Spinner />;
}
}