File tree 1 file changed +15
-6
lines changed
Adamant/Modules/Wallets/Klayr
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -227,19 +227,28 @@ final class KlyTransferViewController: TransferViewControllerBase {
227
227
label. textColor = UIColor . adamant. primary
228
228
}
229
229
} . onChange { [ weak self] row in
230
- var trimmed = row. value? . components (
230
+ defer {
231
+ self ? . updateToolbar ( for: row)
232
+ }
233
+
234
+ guard let text = row. value else { return }
235
+
236
+ var trimmed = text. components (
231
237
separatedBy: TransferViewControllerBase . invalidCharacters
232
- ) . joined ( ) ?? " "
238
+ ) . joined ( )
233
239
234
240
if let prefix = self ? . prefix,
235
241
trimmed. starts ( with: prefix) {
236
242
let i = trimmed. index ( trimmed. startIndex, offsetBy: prefix. count)
237
243
trimmed = String ( trimmed [ i... ] )
238
244
}
239
245
240
- row. value = trimmed
241
- row. updateCell ( )
242
- self ? . updateToolbar ( for: row)
246
+ if text != trimmed {
247
+ DispatchQueue . main. async {
248
+ row. value = trimmed
249
+ row. updateCell ( )
250
+ }
251
+ }
243
252
} . onCellSelection { [ weak self] ( cell, _) in
244
253
self ? . shareValue ( self ? . recipientAddress, from: cell)
245
254
}
@@ -248,6 +257,6 @@ final class KlyTransferViewController: TransferViewControllerBase {
248
257
}
249
258
250
259
override func defaultSceneTitle( ) -> String ? {
251
- return String . adamant. sendKly
260
+ String . adamant. sendKly
252
261
}
253
262
}
You can’t perform that action at this time.
0 commit comments