Fix the "clearing passwords in 45s" function
- Copied passwords in the extension are not cleaned.
This commit is contained in:
parent
f86a5eee65
commit
a4efe57db9
7 changed files with 66 additions and 13 deletions
|
|
@ -94,17 +94,11 @@ public class Utils {
|
|||
print(error)
|
||||
}
|
||||
}
|
||||
public static func copyToPasteboard(textToCopy: String?, expirationTime: Double = 45) {
|
||||
public static func copyToPasteboard(textToCopy: String?) {
|
||||
guard textToCopy != nil else {
|
||||
return
|
||||
}
|
||||
UIPasteboard.general.string = textToCopy
|
||||
DispatchQueue.global(qos: .background).asyncAfter(deadline: DispatchTime.now() + expirationTime) {
|
||||
let pasteboardString: String? = UIPasteboard.general.string
|
||||
if textToCopy == pasteboardString {
|
||||
UIPasteboard.general.string = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
public static func attributedPassword(plainPassword: String) -> NSAttributedString{
|
||||
let attributedPassword = NSMutableAttributedString.init(string: plainPassword)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue