Skip to content

Commit 9336e4c

Browse files
committed
fix: more fixes for profile switch is not sticky
1 parent 2d6fce4 commit 9336e4c

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

package-lock.json

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/plugin-codeflare/src/components/ProfileExplorer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default class ProfileExplorer extends React.PureComponent<Props, State> {
117117
private readonly onSelect = async (evt: React.MouseEvent<HTMLElement>) => {
118118
const selectedProfile = evt.currentTarget.getAttribute("data-profile")
119119
evt.currentTarget.scrollIntoView(true)
120-
if (selectedProfile) {
120+
if (selectedProfile && selectedProfile !== this.state.selectedProfile) {
121121
if (await Profiles.bumpLastUsedTime(selectedProfile)) {
122122
emitSelectProfile(selectedProfile)
123123
this.setState({ selectedProfile })

plugins/plugin-codeflare/src/components/RestartableTerminal.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export default class RestartableTerminal extends React.PureComponent<Props, Stat
5656
private mounted = false
5757

5858
private async initPty() {
59+
if (!this.mounted) {
60+
return
61+
}
62+
5963
try {
6064
// we need this to wire the pty output through to the Terminal
6165
// component, which expects something stream-like

plugins/plugin-codeflare/src/components/SelectedProfileTerminal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import React from "react"
1818
import { Loading } from "@kui-shell/plugin-client-common"
1919

20-
import Terminal, { Props } from "./RestartableTerminal"
20+
import RestartableTerminal, { Props } from "./RestartableTerminal"
2121
import { onSelectProfile, offSelectProfile } from "./ProfileExplorer"
2222

2323
type State = {
@@ -55,7 +55,7 @@ export default class SelectedProfileTerminal extends React.PureComponent<Props,
5555
if (!this.state || !this.state.cmdline) {
5656
return <Loading />
5757
} else {
58-
return <Terminal key={this.state.cmdline} {...this.props} cmdline={this.state.cmdline} />
58+
return <RestartableTerminal key={this.state.cmdline} {...this.props} cmdline={this.state.cmdline} />
5959
}
6060
}
6161
}

plugins/plugin-madwizard/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26-
"madwizard": "^0.18.2"
26+
"madwizard": "^0.18.3"
2727
}
2828
}

0 commit comments

Comments
 (0)