Jordi Bunster
2021-04-07 09:15:00 -07:00
committed by GitHub
parent 9c6178d0ed
commit 4f22d308b3
5 changed files with 46 additions and 12 deletions

View File

@@ -93,6 +93,7 @@ export interface ExplorerParams {
closeSidePanel: () => void;
closeDialog: () => void;
openDialog: (props: DialogProps) => void;
tabsManager: TabsManager;
}
export default class Explorer {
@@ -600,7 +601,7 @@ export default class Explorer {
container: this,
});
this.tabsManager = new TabsManager();
this.tabsManager = params?.tabsManager ?? new TabsManager();
this._panes = [
this.addDatabasePane,

View File

@@ -50,10 +50,6 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
this.subscriptions = [];
}
public shouldComponentUpdate() {
return this.container.tabsManager.openedTabs.length === 0;
}
public componentWillUnmount() {
while (this.subscriptions.length) {
this.subscriptions.pop().dispose();
@@ -62,7 +58,6 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
public componentDidMount() {
this.subscriptions.push(
this.container.tabsManager.openedTabs.subscribe(() => this.setState({})),
this.container.selectedNode.subscribe(() => this.setState({})),
this.container.isNotebookEnabled.subscribe(() => this.setState({}))
);
@@ -80,7 +75,13 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
const tipsItems = this.createTipsItems();
const onClearRecent = this.clearMostRecent;
return (
const formContainer = (jsx: JSX.Element) => (
<div className="connectExplorerContainer">
<form className="connectExplorerFormContainer">{jsx}</form>
</div>
);
return formContainer(
<div className="splashScreenContainer">
<div className="splashScreen">
<div className="title">