1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-25 10:26:02 +02:00
bitwarden-mobile/src/App/Pages/Settings/SyncPage.xaml.cs
aaxdev 3b4ef4d238
Feature sync on refresh (#937)
* Added new option: Sync on refresh

* Removed unused field

* Fixed refreshing on disappearing & unnecessary codes removed

* Requested changes

* Calling storage service instead of a dedicated service function (mobile-specific)
2020-08-05 13:19:27 -04:00

44 lines
996 B
C#

using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
public partial class SyncPage : BaseContentPage
{
private readonly SyncPageViewModel _vm;
public SyncPage()
{
InitializeComponent();
_vm = BindingContext as SyncPageViewModel;
_vm.Page = this;
if (Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected async override void OnAppearing()
{
base.OnAppearing();
await _vm.InitAsync();
}
private async void Sync_Clicked(object sender, EventArgs e)
{
if (DoOnce())
{
await _vm.SyncAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if (DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}