Skip to content

Commit

Permalink
- fixed QR scanner camera permission request issue on Windows desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
firestorm40 committed Sep 24, 2024
1 parent ac032d7 commit 6123e36
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Spixi/Pages/Contacts/ContactNewPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public async void quickScan()
{
var scanPage = new ScanPage();
scanPage.scanSucceeded += HandleScanSucceeded;
await Navigation.PushModalAsync(scanPage);
await Navigation.PushAsync(scanPage, Config.defaultXamarinAnimations);
}

public void processQRResult(string result)
Expand Down
2 changes: 1 addition & 1 deletion Spixi/Pages/Home/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public async void quickScan()
{
var scanPage = new ScanPage();
scanPage.scanSucceeded += HandleScanSucceeded;
await Navigation.PushModalAsync(scanPage);
await Navigation.PushAsync(scanPage, Config.defaultXamarinAnimations);
}
private void HandleScanSucceeded(object sender, SPIXI.EventArgs<string> e)
{
Expand Down
6 changes: 2 additions & 4 deletions Spixi/Pages/Launch/LaunchRestorePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
using SPIXI.Interfaces;
using SPIXI.Lang;
using SPIXI.Meta;
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Web;
using IFilePicker = SPIXI.Interfaces.IFilePicker;

namespace SPIXI
{
Expand Down Expand Up @@ -168,6 +164,8 @@ private bool restoreAccountFile(string source_path, string pass)
}
Directory.Delete(Path.Combine(Config.spixiUserFolder, "Acc"), true);
Directory.Move(Path.Combine(tmpDirectory, "Acc"), Path.Combine(Config.spixiUserFolder, "Acc"));
// Directory.Delete(Path.Combine(Config.spixiUserFolder, "Chats"), true);
// Directory.Move(Path.Combine(tmpDirectory, "Chats"), Path.Combine(Config.spixiUserFolder, "Chats"));
if (File.Exists(Path.Combine(tmpDirectory, "account.ixi")))
{
File.Move(Path.Combine(tmpDirectory, "account.ixi"), Path.Combine(Config.spixiUserFolder, "account.ixi"));
Expand Down
8 changes: 3 additions & 5 deletions Spixi/Pages/Scan/ScanPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ private void onNavigated(object sender, WebNavigatedEventArgs e)

private void onLoad()
{
//Utils.sendUiCommand(webView, "setAddress", wallet_to_add);
}

private void onNavigating(object sender, WebNavigatingEventArgs e)
Expand All @@ -45,8 +44,7 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
}
else if (current_url.Equals("ixian:back", StringComparison.Ordinal))
{
Navigation.PopModalAsync(Config.defaultXamarinAnimations);
GC.Collect();
OnBackButtonPressed();
}
else if (current_url.Equals("ixian:error", StringComparison.Ordinal))
{
Expand Down Expand Up @@ -86,14 +84,14 @@ public void processQRResult(string text)
{
allowScanning = false;
scanSucceeded(this, new SPIXI.EventArgs<string>(wal));
Navigation.PopModalAsync(Config.defaultXamarinAnimations);
OnBackButtonPressed();
}
}

protected override bool OnBackButtonPressed()
{
Navigation.PopAsync(Config.defaultXamarinAnimations);

GC.Collect();
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion Spixi/Pages/Wallet/WalletSendPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public async void quickScan()
{
var scanPage = new ScanPage();
scanPage.scanSucceeded += HandleScanSucceeded;
await Navigation.PushModalAsync(scanPage);
await Navigation.PushAsync(scanPage, Config.defaultXamarinAnimations);
}
public void processQRResult(string result)
{
Expand Down

0 comments on commit 6123e36

Please sign in to comment.