From c81f47759caac6a1df51beb3b3c7242e5d994e90 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 27 Nov 2019 20:04:28 +0800 Subject: [PATCH] handle the displaying of zero height peers --- cyberwow/lib/controller/rpc/rpcView.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cyberwow/lib/controller/rpc/rpcView.dart b/cyberwow/lib/controller/rpc/rpcView.dart index 64c5964..602e60c 100644 --- a/cyberwow/lib/controller/rpc/rpcView.dart +++ b/cyberwow/lib/controller/rpc/rpcView.dart @@ -114,16 +114,20 @@ Map simpleHeight(int height, Map x) { ( (k, v) { if (k == 'height') { - if (v < height) { - return MapEntry('height', '- ${height - v}'); + if (v == 0) { + return MapEntry(k, '☠'); + } + + else if (v < height) { + return MapEntry(k, '- ${height - v}'); } else if (v == height) { - return MapEntry('height', '✓'); + return MapEntry(k, '✓'); } else { - return MapEntry('height', '+ ${v - height}'); + return MapEntry(k, '+ ${v - height}'); } } else {