mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
6a0dc61601
commit
6e79144b6d
@ -1,8 +1,8 @@
|
|||||||
import "./catalog.scss";
|
import "./catalog.scss";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { disposeOnUnmount, observer } from "mobx-react";
|
||||||
import { ItemListLayout } from "../item-object-list";
|
import { ItemListLayout } from "../item-object-list";
|
||||||
import { IReactionDisposer, observable } from "mobx";
|
import { observable } from "mobx";
|
||||||
import { CatalogEntityItem, CatalogEntityStore } from "./catalog-entity.store";
|
import { CatalogEntityItem, CatalogEntityStore } from "./catalog-entity.store";
|
||||||
import { navigate } from "../../navigation";
|
import { navigate } from "../../navigation";
|
||||||
import { kebabCase } from "lodash";
|
import { kebabCase } from "lodash";
|
||||||
@ -26,7 +26,6 @@ enum sortBy {
|
|||||||
export class Catalog extends React.Component {
|
export class Catalog extends React.Component {
|
||||||
@observable private catalogEntityStore?: CatalogEntityStore;
|
@observable private catalogEntityStore?: CatalogEntityStore;
|
||||||
@observable.deep private contextMenu: CatalogEntityContextMenuContext;
|
@observable.deep private contextMenu: CatalogEntityContextMenuContext;
|
||||||
private disposers: IReactionDisposer[] = [];
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.contextMenu = {
|
this.contextMenu = {
|
||||||
@ -34,7 +33,9 @@ export class Catalog extends React.Component {
|
|||||||
navigate: (url: string) => navigate(url)
|
navigate: (url: string) => navigate(url)
|
||||||
};
|
};
|
||||||
this.catalogEntityStore = new CatalogEntityStore();
|
this.catalogEntityStore = new CatalogEntityStore();
|
||||||
this.disposers.push(this.catalogEntityStore.watch());
|
disposeOnUnmount(this, [
|
||||||
|
this.catalogEntityStore.watch()
|
||||||
|
]);
|
||||||
|
|
||||||
if (this.catalogEntityStore.items.length === 0) {
|
if (this.catalogEntityStore.items.length === 0) {
|
||||||
Notifications.info(<><b>Welcome!</b><p>Get started by associating one or more clusters to Lens</p></>, {
|
Notifications.info(<><b>Welcome!</b><p>Get started by associating one or more clusters to Lens</p></>, {
|
||||||
@ -44,10 +45,6 @@ export class Catalog extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
this.disposers.forEach((d) => d());
|
|
||||||
}
|
|
||||||
|
|
||||||
addToHotbar(item: CatalogEntityItem) {
|
addToHotbar(item: CatalogEntityItem) {
|
||||||
const hotbar = hotbarStore.getByName("default"); // FIXME
|
const hotbar = hotbarStore.getByName("default"); // FIXME
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user