use nextlinenum to decide whether to show newtab flow

This commit is contained in:
sawka 2023-11-01 23:10:01 -07:00
parent 90e07266bf
commit 055d00d78a
2 changed files with 5 additions and 2 deletions

View File

@ -382,10 +382,10 @@ class ScreenWindowView extends React.Component<{ session: Session, screen: Scree
</div>
</div>
<If condition={lines.length == 0}>
<If condition={true}>
<If condition={screen.nextLineNum.get() == 1}>
<NewTabSettings screen={screen}/>
</If>
<If condition={false}>
<If condition={screen.nextLineNum.get() != 1}>
<div className="window-view" ref={this.windowViewRef} data-screenid={screen.screenId}>
<div key="lines" className="lines"></div>
<div key="window-empty" className={cn("window-empty")}>

View File

@ -332,6 +332,7 @@ class Screen {
name: OV<string>;
archived: OV<boolean>;
curRemote: OV<RemotePtrType>;
nextLineNum: OV<int>;
lastScreenSize: WindowSize;
lastCols: number;
lastRows: number;
@ -349,6 +350,7 @@ class Screen {
this.sessionId = sdata.sessionid;
this.screenId = sdata.screenid;
this.name = mobx.observable.box(sdata.name, { name: "screen-name" });
this.nextLineNum = mobx.observable.box(sdata.nextlinenum, { name: "screen-nextlinenum" });
this.screenIdx = mobx.observable.box(sdata.screenidx, {
name: "screen-screenidx",
});
@ -424,6 +426,7 @@ class Screen {
this.screenIdx.set(data.screenidx);
this.opts.set(data.screenopts);
this.name.set(data.name);
this.nextLineNum.set(data.nextlinenum);
this.archived.set(!!data.archived);
let oldSelectedLine = this.selectedLine.get();
let oldFocusType = this.focusType.get();