Commit 37e3888 pythcoiner
committed
1 parent a34070d commit 37e3888 Copy full SHA for 37e3888
File tree 3 files changed +24
-2
lines changed
3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,12 @@ impl State for SettingsState {
78
78
}
79
79
Message :: View ( view:: Message :: Settings ( view:: SettingsMessage :: EditWalletSettings ) ) => {
80
80
self . setting = Some (
81
- WalletSettingsState :: new ( self . data_dir . clone ( ) , self . wallet . clone ( ) ) . into ( ) ,
81
+ WalletSettingsState :: new (
82
+ self . data_dir . clone ( ) ,
83
+ self . wallet . clone ( ) ,
84
+ daemon. get_info ( ) . unwrap ( ) . timestamp ,
85
+ )
86
+ . into ( ) ,
82
87
) ;
83
88
self . setting
84
89
. as_mut ( )
Original file line number Diff line number Diff line change @@ -29,10 +29,11 @@ pub struct WalletSettingsState {
29
29
modal : Option < RegisterWalletModal > ,
30
30
processing : bool ,
31
31
updated : bool ,
32
+ creation_date : u32 ,
32
33
}
33
34
34
35
impl WalletSettingsState {
35
- pub fn new ( data_dir : PathBuf , wallet : Arc < Wallet > ) -> Self {
36
+ pub fn new ( data_dir : PathBuf , wallet : Arc < Wallet > , creation_date : u32 ) -> Self {
36
37
WalletSettingsState {
37
38
data_dir,
38
39
descriptor : wallet. main_descriptor . to_string ( ) ,
@@ -42,6 +43,7 @@ impl WalletSettingsState {
42
43
modal : None ,
43
44
processing : false ,
44
45
updated : false ,
46
+ creation_date,
45
47
}
46
48
}
47
49
@@ -81,6 +83,7 @@ impl State for WalletSettingsState {
81
83
& self . keys_aliases ,
82
84
self . processing ,
83
85
self . updated ,
86
+ self . creation_date ,
84
87
) ;
85
88
if let Some ( m) = & self . modal {
86
89
modal:: Modal :: new ( content, m. view ( ) )
Original file line number Diff line number Diff line change @@ -589,6 +589,7 @@ pub fn wallet_settings<'a>(
589
589
keys_aliases : & [ ( Fingerprint , form:: Value < String > ) ] ,
590
590
processing : bool ,
591
591
updated : bool ,
592
+ creation_date : u32 ,
592
593
) -> Element < ' a , Message > {
593
594
dashboard (
594
595
& Menu :: Settings ,
@@ -612,6 +613,7 @@ pub fn wallet_settings<'a>(
612
613
. on_press ( Message :: Settings ( SettingsMessage :: AboutSection ) ) ,
613
614
) ,
614
615
)
616
+ . push_maybe ( creation_date_message ( creation_date) )
615
617
. push ( card:: simple (
616
618
Column :: new ( )
617
619
. push ( text ( "Wallet descriptor:" ) . bold ( ) )
@@ -738,3 +740,15 @@ pub fn register_wallet_modal<'a>(
738
740
. width ( Length :: Fixed ( 500.0 ) )
739
741
. into ( )
740
742
}
743
+
744
+ pub fn creation_date_message ( creation_date : u32 ) -> Option < Row < ' static , Message > > {
745
+ if let Some ( datetime) = chrono:: NaiveDateTime :: from_timestamp_opt ( creation_date as i64 , 0 ) {
746
+ return Some (
747
+ Row :: new ( )
748
+ . push ( text ( "Wallet creation date:" ) . bold ( ) )
749
+ . spacing ( 10 )
750
+ . push ( text ( datetime. format ( "%m/%d/%Y" ) . to_string ( ) ) ) ,
751
+ ) ;
752
+ }
753
+ None
754
+ }
You can’t perform that action at this time.
0 commit comments