mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* add auto-update notifications and confirmation * Show single update notification (#1985) * Moving notification icons to top (#1987) * Switch to EventEmitter (producer&consumer) model * Add `onCorrect` and `onceCorrect` to ipc module for typechecking ipc messages * move type enforced ipc methods to seperate file, add unit tests Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> Signed-off-by: Sebastian Malton <sebastian@malton.name>
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
import "../common/system-ca";
|
|
import React from "react";
|
|
import { Route, Router, Switch } from "react-router";
|
|
import { observer } from "mobx-react";
|
|
import { userStore } from "../common/user-store";
|
|
import { history } from "./navigation";
|
|
import { ClusterManager } from "./components/cluster-manager";
|
|
import { ErrorBoundary } from "./components/error-boundary";
|
|
import { WhatsNew, whatsNewRoute } from "./components/+whats-new";
|
|
import { Notifications } from "./components/notifications";
|
|
import { ConfirmDialog } from "./components/confirm-dialog";
|
|
import { extensionLoader } from "../extensions/extension-loader";
|
|
import { broadcastMessage } from "../common/ipc";
|
|
import { CommandContainer } from "./components/command-palette/command-container";
|
|
import { registerIpcHandlers } from "./ipc";
|
|
|
|
@observer
|
|
export class LensApp extends React.Component {
|
|
static async init() {
|
|
extensionLoader.loadOnClusterManagerRenderer();
|
|
window.addEventListener("offline", () => {
|
|
broadcastMessage("network:offline");
|
|
});
|
|
window.addEventListener("online", () => {
|
|
broadcastMessage("network:online");
|
|
});
|
|
|
|
registerIpcHandlers();
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Router history={history}>
|
|
<ErrorBoundary>
|
|
<Switch>
|
|
{userStore.isNewVersion && <Route component={WhatsNew}/>}
|
|
<Route component={WhatsNew} {...whatsNewRoute}/>
|
|
<Route component={ClusterManager}/>
|
|
</Switch>
|
|
</ErrorBoundary>
|
|
<Notifications/>
|
|
<ConfirmDialog/>
|
|
<CommandContainer />
|
|
</Router>
|
|
);
|
|
}
|
|
}
|