mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
fix for send list refresh on android (#1283)
This commit is contained in:
parent
685548ab72
commit
6fa23475e3
2 changed files with 11 additions and 1 deletions
|
@ -18,6 +18,7 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
private readonly IDeviceActionService _deviceActionService;
|
private readonly IDeviceActionService _deviceActionService;
|
||||||
private readonly IPlatformUtilsService _platformUtilsService;
|
private readonly IPlatformUtilsService _platformUtilsService;
|
||||||
|
private readonly IMessagingService _messagingService;
|
||||||
private readonly IUserService _userService;
|
private readonly IUserService _userService;
|
||||||
private readonly ISendService _sendService;
|
private readonly ISendService _sendService;
|
||||||
private bool _sendEnabled;
|
private bool _sendEnabled;
|
||||||
|
@ -44,6 +45,7 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
|
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
|
||||||
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
||||||
|
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||||
_userService = ServiceContainer.Resolve<IUserService>("userService");
|
_userService = ServiceContainer.Resolve<IUserService>("userService");
|
||||||
_sendService = ServiceContainer.Resolve<ISendService>("sendService");
|
_sendService = ServiceContainer.Resolve<ISendService>("sendService");
|
||||||
TogglePasswordCommand = new Command(TogglePassword);
|
TogglePasswordCommand = new Command(TogglePassword);
|
||||||
|
@ -350,6 +352,14 @@ namespace Bit.App.Pages
|
||||||
EditMode ? AppResources.SendUpdated : AppResources.NewSendCreated);
|
EditMode ? AppResources.SendUpdated : AppResources.NewSendCreated);
|
||||||
await Page.Navigation.PopModalAsync();
|
await Page.Navigation.PopModalAsync();
|
||||||
|
|
||||||
|
if (Device.RuntimePlatform == Device.Android && IsFile)
|
||||||
|
{
|
||||||
|
// Workaround for https://github.com/xamarin/Xamarin.Forms/issues/5418
|
||||||
|
// Exiting and returning (file picker) calls OnAppearing on list page instead of this modal, and
|
||||||
|
// it doesn't get called again when the model is dismissed, so the list isn't updated.
|
||||||
|
_messagingService.Send("sendUpdated");
|
||||||
|
}
|
||||||
|
|
||||||
if (ShareOnSave)
|
if (ShareOnSave)
|
||||||
{
|
{
|
||||||
var savedSend = await _sendService.GetAsync(sendId);
|
var savedSend = await _sendService.GetAsync(sendId);
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
Device.BeginInvokeOnMainThread(() => IsBusy = true);
|
Device.BeginInvokeOnMainThread(() => IsBusy = true);
|
||||||
}
|
}
|
||||||
else if (message.Command == "syncCompleted")
|
else if (message.Command == "syncCompleted" || message.Command == "sendUpdated")
|
||||||
{
|
{
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
Device.BeginInvokeOnMainThread(() =>
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
|
|
Loading…
Reference in a new issue