@ -15,7 +15,7 @@ const NO_ERROR = {};
|
||||
|
||||
export default class ErrorBoundary extends React.Component<React.PropsWithChildren<Props>> {
|
||||
static wrap<T = any>(Component: React.ComponentType<T>): (props: T) => React.ReactElement {
|
||||
return (props) => (
|
||||
return props => (
|
||||
<ErrorBoundary>
|
||||
<Component {...props as any/* I hate react typings ??? */} />
|
||||
</ErrorBoundary>
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { PropsWithChildren } from "react";
|
||||
import type { React } from '../webpack/common';
|
||||
import type { React } from "../webpack/common";
|
||||
|
||||
export function Flex(props: React.PropsWithChildren<{
|
||||
flexDirection?: React.CSSProperties["flexDirection"];
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { classes, humanFriendlyJoin, useAwaiter } from "../utils/misc";
|
||||
import Plugins from 'plugins';
|
||||
import Plugins from "plugins";
|
||||
import { useSettings } from "../api/settings";
|
||||
import IpcEvents from "../utils/IpcEvents";
|
||||
|
||||
import { Button, Switch, Forms, React, Margins, Toasts, Alerts, Parser } from "../webpack/common";
|
||||
import ErrorBoundary from "./ErrorBoundary";
|
||||
import { startPlugin } from "../plugins";
|
||||
import { stopPlugin } from '../plugins/index';
|
||||
import { Flex } from './Flex';
|
||||
import { ChangeList } from '../utils/ChangeList';
|
||||
import { stopPlugin } from "../plugins/index";
|
||||
import { Flex } from "./Flex";
|
||||
import { ChangeList } from "../utils/ChangeList";
|
||||
|
||||
function showErrorToast(message: string) {
|
||||
Toasts.show({
|
||||
@ -35,7 +35,7 @@ export default ErrorBoundary.wrap(function Settings() {
|
||||
<div>{changes.map((s, i) => (
|
||||
<>
|
||||
{i > 0 && ", "}
|
||||
{Parser.parse('`' + s + '`')}
|
||||
{Parser.parse("`" + s + "`")}
|
||||
</>
|
||||
))}</div>
|
||||
</>
|
||||
@ -69,7 +69,7 @@ export default ErrorBoundary.wrap(function Settings() {
|
||||
</Forms.FormTitle>
|
||||
|
||||
<Forms.FormText>
|
||||
SettingsDir: <code style={{ userSelect: 'text', cursor: 'text' }}>{settingsDir}</code>
|
||||
SettingsDir: <code style={{ userSelect: "text", cursor: "text" }}>{settingsDir}</code>
|
||||
</Forms.FormText>
|
||||
|
||||
{!IS_WEB && <Flex className={classes(Margins.marginBottom20)}>
|
||||
|
@ -1,8 +1,8 @@
|
||||
import gitHash from "git-hash";
|
||||
import { changes, checkForUpdates, getRepo, rebuild, update, UpdateLogger, updateError, isOutdated, isNewer } from '../utils/updater';
|
||||
import { React, Forms, Button, Margins, Alerts, Card, Parser, Toasts } from '../webpack/common';
|
||||
import { changes, checkForUpdates, getRepo, rebuild, update, UpdateLogger, updateError, isOutdated, isNewer } from "../utils/updater";
|
||||
import { React, Forms, Button, Margins, Alerts, Card, Parser, Toasts } from "../webpack/common";
|
||||
import { Flex } from "./Flex";
|
||||
import { classes, useAwaiter } from '../utils/misc';
|
||||
import { classes, useAwaiter } from "../utils/misc";
|
||||
import { Link } from "./Link";
|
||||
import ErrorBoundary from "./ErrorBoundary";
|
||||
import { ErrorCard } from "./ErrorCard";
|
||||
|
Reference in New Issue
Block a user