Removed observer for myNode, probably not a good idea

This commit is contained in:
Vadim Furman 2021-01-25 17:50:16 -08:00
parent 8ea58fd08c
commit 9a13f933b8

View file

@ -231,11 +231,6 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
layoutManager.stackFromEnd = true // We want the last rows to always be shown
binding.messageListView.layoutManager = layoutManager
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
model.messagesState.messages.observe(viewLifecycleOwner, Observer {
debug("New messages received: ${it.size}")
messagesAdapter.onMessagesChanged(it)
@ -253,12 +248,6 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
binding.textInputLayout.isEnabled =
model.isConnected.value != MeshService.ConnectionState.DISCONNECTED && myId != null
})
model.myNodeInfo.observe(viewLifecycleOwner, Observer { myNodeInfo ->
// If our Id changed, the UI may need to be updated
messagesAdapter.notifyDataSetChanged()
debug("New id received ${myNodeInfo?.myNodeNum}")
})
}
}