File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 289
289
}
290
290
},
291
291
"Copy" : {
292
+ "extractionState" : "stale",
292
293
"localizations" : {
293
294
"fr" : {
294
295
"stringUnit" : {
327
328
}
328
329
}
329
330
}
331
+ },
332
+ "Descriptor" : {
333
+
330
334
},
331
335
"Destructive Zone" : {
332
336
"localizations" : {
576
580
}
577
581
}
578
582
}
583
+ },
584
+ "Seed" : {
585
+
579
586
},
580
587
"Seed is not synced across devices." : {
581
588
Original file line number Diff line number Diff line change @@ -13,18 +13,21 @@ import SwiftUI
13
13
@MainActor
14
14
class SeedViewModel {
15
15
let bdkService : BDKClient
16
+ let keyService : KeyClient
16
17
17
18
var seed : BackupInfo ?
18
19
var seedViewError : AppError ?
19
20
var showingSeedViewErrorAlert : Bool
20
21
21
22
init (
22
23
bdkService: BDKClient = . live,
24
+ keyService: KeyClient = . live,
23
25
seed: BackupInfo ? = nil ,
24
26
seedViewError: AppError ? = nil ,
25
27
showingSeedViewErrorAlert: Bool = false
26
28
) {
27
29
self . bdkService = bdkService
30
+ self . keyService = keyService
28
31
self . seed = seed
29
32
self . seedViewError = seedViewError
30
33
self . showingSeedViewErrorAlert = showingSeedViewErrorAlert
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ struct SeedView: View {
55
55
? " document.on.document.fill " : " document.on.document "
56
56
)
57
57
. contentTransition ( . symbolEffect( . replace) )
58
- Text ( " Copy " )
58
+ Text ( " Seed " )
59
59
. bold ( )
60
60
}
61
61
}
@@ -70,6 +70,39 @@ struct SeedView: View {
70
70
)
71
71
Spacer ( )
72
72
}
73
+
74
+ HStack {
75
+ Spacer ( )
76
+ Button {
77
+ UIPasteboard . general. string = seed. descriptor
78
+ isCopied = true
79
+ showCheckmark = true
80
+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 1 ) {
81
+ isCopied = false
82
+ showCheckmark = false
83
+ }
84
+ } label: {
85
+ HStack {
86
+ Image (
87
+ systemName: showCheckmark
88
+ ? " document.on.document.fill " : " document.on.document "
89
+ )
90
+ . contentTransition ( . symbolEffect( . replace) )
91
+ Text ( " Descriptor " )
92
+ . bold ( )
93
+ }
94
+ }
95
+ . buttonStyle (
96
+ BitcoinFilled (
97
+ width: 160 ,
98
+ height: 40 ,
99
+ tintColor: . primary,
100
+ textColor: Color ( uiColor: . systemBackground) ,
101
+ isCapsule: true
102
+ )
103
+ )
104
+ Spacer ( )
105
+ }
73
106
. padding ( )
74
107
} else {
75
108
Text ( " No seed available " )
You can’t perform that action at this time.
0 commit comments