mirror of
https://github.com/bitwarden/mobile
synced 2025-12-17 00:33:20 +00:00
Fix Clipboard clear after time on iOS (#1679)
* Fixed Clipboard clear after x seconds depending on what the user set. Also refactored a bit to make the Clipboard a custom service to provide a better way to handle this situation #1464 * Clear some usings #1464
This commit is contained in:
committed by
GitHub
parent
23a164b245
commit
705b8ac12b
@@ -13,6 +13,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
private readonly IPasswordGenerationService _passwordGenerationService;
|
||||
private readonly IPlatformUtilsService _platformUtilsService;
|
||||
private readonly IClipboardService _clipboardService;
|
||||
|
||||
private PasswordGenerationOptions _options;
|
||||
private PasswordGeneratorPolicyOptions _enforcedPolicyOptions;
|
||||
@@ -38,6 +39,8 @@ namespace Bit.App.Pages
|
||||
_passwordGenerationService = ServiceContainer.Resolve<IPasswordGenerationService>(
|
||||
"passwordGenerationService");
|
||||
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
||||
_clipboardService = ServiceContainer.Resolve<IClipboardService>("clipboardService");
|
||||
|
||||
PageTitle = AppResources.PasswordGenerator;
|
||||
TypeOptions = new List<string> { AppResources.Password, AppResources.Passphrase };
|
||||
}
|
||||
@@ -305,7 +308,7 @@ namespace Bit.App.Pages
|
||||
|
||||
public async Task CopyAsync()
|
||||
{
|
||||
await _platformUtilsService.CopyToClipboardAsync(Password);
|
||||
await _clipboardService.CopyTextAsync(Password);
|
||||
_platformUtilsService.ShowToast("success", null,
|
||||
string.Format(AppResources.ValueHasBeenCopied, AppResources.Password));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user