Skip to content

Commit 0174ade

Browse files
authored
Connections Typeahead Additional Fixes (#1457)
1 parent f1a590f commit 0174ade

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

frontend/app/block/blockframe.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ const ChangeConnectionBlockModal = React.memo(
637637
const connStatusMap = new Map<string, ConnStatus>();
638638
const fullConfig = jotai.useAtomValue(atoms.fullConfigAtom);
639639
const connectionsConfig = fullConfig.connections;
640-
let filterOutNowsh = util.useAtomValueSafe(viewModel.filterOutNowsh) || true;
640+
let filterOutNowsh = util.useAtomValueSafe(viewModel.filterOutNowsh) ?? true;
641641

642642
let maxActiveConnNum = 1;
643643
for (const conn of allConnStatus) {
@@ -706,30 +706,30 @@ const ChangeConnectionBlockModal = React.memo(
706706
}
707707
const filteredList: Array<string> = [];
708708
for (const conn of connList) {
709-
if (conn === connSelected) {
710-
createNew = false;
711-
}
712709
if (
713710
conn.includes(connSelected) &&
714711
connectionsConfig?.[conn]?.["display:hidden"] != true &&
715712
(connectionsConfig?.[conn]?.["conn:wshenabled"] != false || !filterOutNowsh)
716713
// != false is necessary because of defaults
717714
) {
718715
filteredList.push(conn);
716+
if (conn === connSelected) {
717+
createNew = false;
718+
}
719719
}
720720
}
721721
const filteredWslList: Array<string> = [];
722722
for (const conn of wslList) {
723-
if (conn === connSelected) {
724-
createNew = false;
725-
}
726723
if (
727724
conn.includes(connSelected) &&
728725
connectionsConfig?.[conn]?.["display:hidden"] != true &&
729726
(connectionsConfig?.[conn]?.["conn:wshenabled"] != false || !filterOutNowsh)
730727
// != false is necessary because of defaults
731728
) {
732729
filteredWslList.push(conn);
730+
if (conn === connSelected) {
731+
createNew = false;
732+
}
733733
}
734734
}
735735
// priority handles special suggestions when necessary

pkg/remote/conncontroller/conncontroller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,10 @@ func GetConnectionsFromInternalConfig() []string {
733733
var internalNames []string
734734
config := wconfig.ReadFullConfig()
735735
for internalName := range config.Connections {
736+
if strings.HasPrefix(internalName, "wsl://") {
737+
// don't add wsl conns to this list
738+
continue
739+
}
736740
internalNames = append(internalNames, internalName)
737741
}
738742
return internalNames

0 commit comments

Comments
 (0)