1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 08:47:24 +00:00

only clearView when switching successfully?

This commit is contained in:
2019-09-17 20:49:13 -04:00
parent bebb14a1dc
commit 16173d6234

View File

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