Exemplo n.º 1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            if (!await AppHelpers.IsVaultTimeoutImmediateAsync())
            {
                await _vaultTimeoutService.CheckVaultTimeoutAsync();
            }
            if (await _vaultTimeoutService.IsLockedAsync())
            {
                return;
            }
            await LoadOnAppearedAsync(_scrollView, true, async() =>
            {
                var success = await _vm.LoadAsync(_appOptions);
                if (!success)
                {
                    await Navigation.PopModalAsync();
                    return;
                }
                AdjustToolbar();
                await ShowAlertsAsync();
                if (!_vm.EditMode && string.IsNullOrWhiteSpace(_vm.Cipher?.Name))
                {
                    RequestFocus(_nameEntry);
                }
                _scrollView.Scrolled += (sender, args) => _vm.HandleScroll();
            });

            // Hide password reprompt option if using key connector
            _passwordPrompt.IsVisible = !await _keyConnectorService.GetUsesKeyConnector();
        }
 protected override async void OnAppearing()
 {
     base.OnAppearing();
     await LoadOnAppearedAsync(_scrollView, true, async() =>
     {
         var success = await _vm.LoadAsync(_appOptions);
         if (!success)
         {
             await Navigation.PopModalAsync();
             return;
         }
         AdjustToolbar();
         await ShowAlertsAsync();
         if (!_vm.EditMode && string.IsNullOrWhiteSpace(_vm.Cipher?.Name))
         {
             RequestFocus(_nameEntry);
         }
         _scrollView.Scrolled += (sender, args) => _vm.HandleScroll();
     });
 }