ui: add suffix to persistent keepalive in editor

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2020-04-06 18:24:08 -06:00
parent 77b5937fbb
commit 4bbb1a0fcd
4 changed files with 20 additions and 2 deletions
@@ -151,4 +151,15 @@ object BindingAdapters {
fun setInetAddressSetText(view: TextView, addresses: Iterable<InetAddress?>?) {
view.text = if (addresses != null) Attribute.join(addresses.map { it?.hostAddress }) else ""
}
@JvmStatic
fun tryParseInt(s: String?): Int {
if (s == null)
return 0
return try {
Integer.parseInt(s)
} catch (_: Exception) {
0
}
}
}