mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
Fixed: #57
This commit is contained in:
parent
54f934a682
commit
f7a6944363
@ -1,5 +1,6 @@
|
|||||||
using Borepin.Base;
|
using Borepin.Base;
|
||||||
using Borepin.Service.BFFH;
|
using Borepin.Service.BFFH;
|
||||||
|
using Borepin.Service.BFFH.Exceptions;
|
||||||
using FabAccessAPI.Schema;
|
using FabAccessAPI.Schema;
|
||||||
using Prism.Commands;
|
using Prism.Commands;
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
@ -97,8 +98,21 @@ namespace Borepin.PageModel
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// END HACK
|
// END HACK
|
||||||
|
string id = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
id = await QRToID(ScanResult.Text).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch(ReconnectingFailedException)
|
||||||
|
{
|
||||||
|
Device.BeginInvokeOnMainThread(async () =>
|
||||||
|
{
|
||||||
|
await _PageDialogService.DisplayAlertAsync("Connection failed", "Please reconnect to the server.", "OK").ConfigureAwait(false);
|
||||||
|
IsScanning = true;
|
||||||
|
});
|
||||||
|
|
||||||
string id = await QRToID(ScanResult.Text).ConfigureAwait(false);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (id != null)
|
if (id != null)
|
||||||
{
|
{
|
||||||
@ -119,13 +133,18 @@ namespace Borepin.PageModel
|
|||||||
await _PageDialogService.DisplayAlertAsync("Alert", "QR Code is invalid", "OK").ConfigureAwait(false);
|
await _PageDialogService.DisplayAlertAsync("Alert", "QR Code is invalid", "OK").ConfigureAwait(false);
|
||||||
IsScanning = true;
|
IsScanning = true;
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsScanning = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> QRToID(string value)
|
public async Task<string> QRToID(string value)
|
||||||
{
|
{
|
||||||
if (!_BFFHService.IsConnected)
|
if (!_BFFHService.IsConnected)
|
||||||
{
|
{
|
||||||
|
await _BFFHService.Reconnect().ConfigureAwait(false);
|
||||||
|
|
||||||
IsConnected = false;
|
IsConnected = false;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user