mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: terminal resize on initial open (dock without tabs)
fix: console errors when closing all dock tabs Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
969be592de
commit
22a800ce73
@ -32,7 +32,7 @@ import throttle from "lodash/throttle";
|
|||||||
|
|
||||||
export interface DockTabContentProps extends React.HTMLAttributes<any> {
|
export interface DockTabContentProps extends React.HTMLAttributes<any> {
|
||||||
className?: string;
|
className?: string;
|
||||||
tab: DockTab;
|
tab?: DockTab;
|
||||||
bindContainerRef?(elem: HTMLElement): void;
|
bindContainerRef?(elem: HTMLElement): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,18 +55,18 @@ export class DockTabContent extends React.Component<DockTabContentProps> {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get tabId(): TabId {
|
@computed get tabId(): TabId | undefined {
|
||||||
return this.props.tab.id;
|
return this.props.tab?.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get tabComponents(): DockTabComponents {
|
@computed get tabComponents(): DockTabComponents | undefined {
|
||||||
return dockViewsManager.get(this.props.tab.kind);
|
return dockViewsManager.get(this.props.tab?.kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
@observable error = "";
|
@observable error = "";
|
||||||
|
|
||||||
@computed get editorIsVisible() {
|
@computed get editorIsVisible() {
|
||||||
return Boolean(this.tabComponents.editor);
|
return Boolean(this.tabComponents?.editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
focusEditor() {
|
focusEditor() {
|
||||||
|
|||||||
@ -40,7 +40,7 @@ const dockViews = observable.map<TabKind, DockTabComponents>([], {
|
|||||||
|
|
||||||
export const dockViewsManager = {
|
export const dockViewsManager = {
|
||||||
get(tabKind: TabKind): DockTabComponents {
|
get(tabKind: TabKind): DockTabComponents {
|
||||||
return dockViews.get(tabKind) ?? {};
|
return dockViews.get(tabKind);
|
||||||
},
|
},
|
||||||
|
|
||||||
register(tabKind: TabKind, views: DockTabComponents) {
|
register(tabKind: TabKind, views: DockTabComponents) {
|
||||||
|
|||||||
@ -47,7 +47,9 @@ export class TerminalWindow extends React.Component<Props> {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
// refresh terminal available space (cols/rows) when <Dock/> resized
|
// refresh terminal available space (cols/rows) when <Dock/> resized
|
||||||
dockStore.onResize(() => this.terminal?.fitLazy()),
|
dockStore.onResize(() => this.terminal?.fitLazy(), {
|
||||||
|
fireImmediately: true,
|
||||||
|
}),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -179,11 +179,7 @@ export class MonacoEditor extends React.Component<MonacoEditorProps> {
|
|||||||
reaction(() => this.model, this.onModelChange),
|
reaction(() => this.model, this.onModelChange),
|
||||||
reaction(() => this.props.theme, editor.setTheme),
|
reaction(() => this.props.theme, editor.setTheme),
|
||||||
reaction(() => this.props.value, value => this.setValue(value)),
|
reaction(() => this.props.value, value => this.setValue(value)),
|
||||||
reaction(() => this.options, opts => {
|
reaction(() => this.options, opts => this.editor.updateOptions(opts)),
|
||||||
|
|
||||||
console.log('OPTS', opts)
|
|
||||||
this.editor.updateOptions(opts);
|
|
||||||
}),
|
|
||||||
|
|
||||||
() => onDidLayoutChangeDisposer.dispose(),
|
() => onDidLayoutChangeDisposer.dispose(),
|
||||||
() => onValueChangeDisposer.dispose(),
|
() => onValueChangeDisposer.dispose(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user