Browse Source

only clearView when switching successfully?

pull/1/head
Gregory Rudolph 5 years ago
parent
commit
16173d6234
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 3
      main.go

3
main.go

@ -188,16 +188,17 @@ func handleInput(g *gocui.Gui) error {
case "/q": case "/q":
return gocui.ErrQuit return gocui.ErrQuit
case "/j": case "/j":
clearView(g, "Chat")
if len(command) == 3 { if len(command) == 3 {
channel.MembersType = keybase.TEAM channel.MembersType = keybase.TEAM
channel.Name = command[1] channel.Name = command[1]
channel.TopicName = command[2] channel.TopicName = command[2]
printToView(g, "Feed", fmt.Sprintf("You have joined: @%s#%s", channel.Name, channel.TopicName)) printToView(g, "Feed", fmt.Sprintf("You have joined: @%s#%s", channel.Name, channel.TopicName))
clearView(g, "Chat")
} else if len(command) == 2 { } else if len(command) == 2 {
channel.MembersType = keybase.USER channel.MembersType = keybase.USER
channel.Name = command[1] channel.Name = command[1]
printToView(g, "Feed", fmt.Sprintf("You have joined: @%s", channel.Name)) printToView(g, "Feed", fmt.Sprintf("You have joined: @%s", channel.Name))
clearView(g, "Chat")
} else { } else {
printToView(g, "Feed", "To join a team use /j <team> <channel>") printToView(g, "Feed", "To join a team use /j <team> <channel>")
printToView(g, "Feed", "To join a PM use /j <user>") printToView(g, "Feed", "To join a PM use /j <user>")

Loading…
Cancel
Save