don't let users try to send texts if we don't have a node id

This commit is contained in:
geeksville 2020-04-19 12:31:27 -07:00
parent 547e59754d
commit fdd3b48364
2 changed files with 9 additions and 2 deletions

View file

@ -44,7 +44,7 @@ class NodeDB(private val ui: UIViewModel) {
private val seedWithTestNodes = isEmulator
/// The unique ID of our node
val myId = object : MutableLiveData<String>(if (isEmulator) "+16508765309" else "invalid") {}
val myId = object : MutableLiveData<String?>(if (isEmulator) "+16508765309" else null) {}
/// A map from nodeid to to nodeinfo
val nodes =
@ -53,5 +53,5 @@ class NodeDB(private val ui: UIViewModel) {
.toTypedArray())) {}
/// Could be null if we haven't received our node DB yet
val ourNodeInfo get() = nodes.value!![myId.value]
val ourNodeInfo get() = nodes.value?.get(myId.value)
}