Skip to content

Commit

Permalink
Merge branch 'NAS-133545' of github.com:truenas/webui into NAS-133545
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft committed Jan 14, 2025
2 parents 088d086 + 749e37f commit 2345a76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/modules/loader/app-loader.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FocusService } from 'app/services/focus.service';

@Injectable({ providedIn: 'root' })
export class AppLoaderService {
dialogRef: MatDialogRef<AppLoaderComponent> | null;
dialogRef: MatDialogRef<AppLoaderComponent> | null = null;

constructor(
private matDialog: MatDialog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class TerminalComponent implements OnInit, OnDestroy {
this.xterm.options.fontSize = this.fontSize;
this.fitAddon.fit();
const size = this.fitAddon.proposeDimensions();
if (size) {
if (size && this.connectionId) {
this.api.call('core.resize_shell', [this.connectionId, size.cols, size.rows]).pipe(untilDestroyed(this)).subscribe(() => {
this.xterm.focus();
});
Expand All @@ -200,12 +200,14 @@ export class TerminalComponent implements OnInit, OnDestroy {
initializeWebShell(): void {
this.shellService.connect(this.token, this.conf().connectionData);

this.shellService.shellConnected$.pipe(untilDestroyed(this)).subscribe((event: ShellConnectedEvent) => {
this.shellConnected = event.connected;
this.connectionId = event.id;
this.updateTerminal();
this.resizeTerm();
});
this.shellService.shellConnected$
.pipe(filter(Boolean), untilDestroyed(this))
.subscribe((event: ShellConnectedEvent) => {
this.shellConnected = event.connected;
this.connectionId = event.id;
this.updateTerminal();
this.resizeTerm();
});
}

resetDefault(): void {
Expand Down

0 comments on commit 2345a76

Please sign in to comment.