From 8df247626638347d65d83c34739acebaa738fdfc Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Sat, 25 Feb 2023 13:38:09 +0900
Subject: [PATCH] Improve error handling on channel component
---
.../lightning/channel/channel.component.html | 47 +++++++++----------
.../lightning/channel/channel.component.ts | 4 +-
.../app/lightning/node/node.component.html | 23 +++++----
3 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/frontend/src/app/lightning/channel/channel.component.html b/frontend/src/app/lightning/channel/channel.component.html
index f52b85762..96af4ab67 100644
--- a/frontend/src/app/lightning/channel/channel.component.html
+++ b/frontend/src/app/lightning/channel/channel.component.html
@@ -1,25 +1,32 @@
-
Lightning channel
-
-
-
Inactive
-
Active
-
Closed
-
-
+
+
+ Lightning channel
+
+
+
Inactive
+
Active
+
Closed
+
+
+
+
+ No channel found for short id "{{ channel.short_id }}"
+
+
-
+
@@ -65,7 +72,7 @@
-
+
@@ -104,14 +111,6 @@
-
-
- Error loading data.
-
- {{ error.status }}: {{ error.error }}
-
-
-
Lightning channel
diff --git a/frontend/src/app/lightning/channel/channel.component.ts b/frontend/src/app/lightning/channel/channel.component.ts
index 379e8a005..d57aa3f01 100644
--- a/frontend/src/app/lightning/channel/channel.component.ts
+++ b/frontend/src/app/lightning/channel/channel.component.ts
@@ -38,7 +38,9 @@ export class ChannelComponent implements OnInit {
}),
catchError((err) => {
this.error = err;
- return of(null);
+ return [{
+ short_id: params.get('short_id')
+ }];
})
);
}),
diff --git a/frontend/src/app/lightning/node/node.component.html b/frontend/src/app/lightning/node/node.component.html
index 575614c10..1519eb1da 100644
--- a/frontend/src/app/lightning/node/node.component.html
+++ b/frontend/src/app/lightning/node/node.component.html
@@ -1,15 +1,18 @@
-
Lightning node
-
-
{{ node.alias }}
-
-
-
-
-
+
+
+ Lightning node
+
+
{{ node.alias }}
+
+
+
+
+
+
-
-
+
+