File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,6 +277,8 @@ func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
277277 name := m .deleteModel .lastDeleted
278278 m .connectModel .RemoveByName (name )
279279 m .editModel .RemoveByName (name )
280+ m .sqliteConns = removeConnByName (m .sqliteConns , name )
281+ m .sshConfigConns = removeConnByName (m .sshConfigConns , name )
280282 m .deleteModel .lastDeleted = ""
281283 m .setStatus (fmt .Sprintf ("%q deleted" , name ), successStyle )
282284 }
@@ -910,6 +912,15 @@ func (m *AppModel) setError(format string, a ...any) {
910912 m .statusMsgRight = false
911913}
912914
915+ func removeConnByName (conns []model.Connection , name string ) []model.Connection {
916+ for i , c := range conns {
917+ if c .Name == name {
918+ return append (conns [:i ], conns [i + 1 :]... )
919+ }
920+ }
921+ return conns
922+ }
923+
913924func expandTildeTUI (path string ) string {
914925 if strings .HasPrefix (path , "~/" ) {
915926 home , err := os .UserHomeDir ()
You can’t perform that action at this time.
0 commit comments