Fix infinite recursion

This commit is contained in:
Tulir Asokan
2019-06-15 18:03:28 +03:00
parent 0f08c49df4
commit ef509eb308
2 changed files with 27 additions and 15 deletions

View File

@ -93,17 +93,14 @@ func NewRoomView(parent *MainView, room *rooms.Room) *RoomView {
config: parent.config,
}
view.content = NewMessageView(view)
view.Room.SetOnUnload(func() bool {
view.Room.SetPreUnload(func() bool {
if view.parent.currentRoom == view {
return false
}
view.content.Unload()
return true
})
view.Room.SetOnLoad(func() bool {
view.loadTyping()
return true
})
view.Room.SetPostLoad(view.loadTyping)
view.input.
SetBackgroundColor(tcell.ColorDefault).