@@ -59,7 +59,7 @@ fn draw_secret_block(f: &mut Frame<'_>, app: &mut App, area: Rect) {
59
59
app. update_block_map ( get_route ( ActiveBlock :: DecoderSecret ) , area) ;
60
60
61
61
let block = get_selectable_block (
62
- "Verify Signature" ,
62
+ check_verification_status ( app . data . decoder . signature_verified ) ,
63
63
* app. data . decoder . blocks . get_active_block ( ) == ActiveBlock :: DecoderSecret ,
64
64
Some ( & app. data . decoder . secret . input_mode ) ,
65
65
app. light_theme ,
@@ -81,6 +81,14 @@ fn draw_secret_block(f: &mut Frame<'_>, app: &mut App, area: Rect) {
81
81
render_input_widget ( f, chunks[ 1 ] , & app. data . decoder . secret , app. light_theme ) ;
82
82
}
83
83
84
+ fn check_verification_status ( signature_verified : bool ) -> & ' static str {
85
+ if signature_verified {
86
+ "Signature: ✅ Valid"
87
+ } else {
88
+ "Signature: ❌ Invalid"
89
+ }
90
+ }
91
+
84
92
fn draw_header_block ( f : & mut Frame < ' _ > , app : & mut App , area : Rect ) {
85
93
app. update_block_map ( get_route ( ActiveBlock :: DecoderHeader ) , area) ;
86
94
@@ -183,7 +191,7 @@ mod tests {
183
191
r#"││ │││ "name": "John Doe", │"# ,
184
192
r#"│└──────────────────────────────────────────────┘││ "sub": "1234567890" │"# ,
185
193
r#"└────────────────────────────────────────────────┘│} │"# ,
186
- r#"┌ Verify Signature ─── ───────────────────────────┐│ │"# ,
194
+ r#"┌ Signature: ✅ Valid ───────────────────────────┐│ │"# ,
187
195
r#"│Prepend 'b64:' for base64 encoded secret. Prepen││ │"# ,
188
196
r#"│┌──────────────────────────────────────────────┐││ │"# ,
189
197
r#"││secret │││ │"# ,
@@ -202,7 +210,7 @@ mod tests {
202
210
. add_modifier ( Modifier :: BOLD ) ,
203
211
) ;
204
212
}
205
- ( 51 ..=82 , 0 ) | ( 51 ..=67 , 8 ) | ( 1 ..=18 , 14 ) => {
213
+ ( 51 ..=82 , 0 ) | ( 51 ..=67 , 8 ) | ( 1 ..=21 , 14 ) => {
206
214
expected. get_mut ( col, row) . set_style (
207
215
Style :: default ( )
208
216
. fg ( COLOR_WHITE )
0 commit comments