mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-10 19:58:00 +01:00
fix excessive line rendering with mobx.computed
This commit is contained in:
parent
9f034f39d4
commit
ac447e072b
15
src/main.tsx
15
src/main.tsx
@ -444,11 +444,16 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width
|
||||
let status = cmd.getStatus();
|
||||
let termOpts = cmd.getTermOpts();
|
||||
let lineNumStr = (line.linenumtemp ? "~" : "") + String(line.linenum);
|
||||
let isSelected = (sw.selectedLine.get() == line.linenum);
|
||||
let isPhysicalFocused = sw.getIsFocused(line.linenum);
|
||||
let swFocusType = sw.focusType.get();
|
||||
let isFocused = isPhysicalFocused && (swFocusType == "cmd" || swFocusType == "cmd-fg");
|
||||
let isFgFocused = isPhysicalFocused && swFocusType == "cmd-fg";
|
||||
let isSelected = mobx.computed(() => (sw.selectedLine.get() == line.linenum), {name: "computed-isSelected"}).get();
|
||||
let isPhysicalFocused = mobx.computed(() => sw.getIsFocused(line.linenum), {name: "computed-getIsFocused"}).get();
|
||||
let isFocused = mobx.computed(() => {
|
||||
let swFocusType = sw.focusType.get();
|
||||
return isPhysicalFocused && (swFocusType == "cmd" || swFocusType == "cmd-fg")
|
||||
}, {name: "computed-isFocused"}).get();
|
||||
let isFgFocused = mobx.computed(() => {
|
||||
let swFocusType = sw.focusType.get();
|
||||
return isPhysicalFocused && swFocusType == "cmd-fg"
|
||||
}, {name: "computed-isFgFocused"}).get();
|
||||
let isStatic = staticRender;
|
||||
let rsdiff = this.rtnStateDiff.get();
|
||||
// console.log("render", "#" + line.linenum, termHeight, usedRows, cmd.getStatus(), (this.rtnStateDiff.get() != null), (!cmd.isRunning() ? "cmd-done" : "running"));
|
||||
|
Loading…
Reference in New Issue
Block a user