Skip to content

Commit

Permalink
Using correct ClientTypes;
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karuna committed Nov 19, 2021
1 parent 3151147 commit b9093c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,16 @@ private void InactivityHandler(object sender, EventArgs args)

var unlockViewModel = new UnlockViewModel(accountName, password =>
{
var clientType = ClientType.Unknown;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) clientType = ClientType.AvaloniaWindows;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) clientType = ClientType.AvaloniaMac;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) clientType = ClientType.AvaloniaLinux;
var _ = Account.LoadFromFile(
pathToAccount: pathToAccount,
password: password,
currenciesProvider: AtomexApp.CurrenciesProvider,
clientType: ClientType.Unknown);
clientType: clientType);
}, async () => await SignOut());

var wasClosed = false;
Expand Down
8 changes: 7 additions & 1 deletion ViewModels/MyWalletsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Input;
using Atomex.Client.Desktop.Common;
using Atomex.Common;
Expand Down Expand Up @@ -52,11 +53,16 @@ public MyWalletsViewModel(
var unlockViewModel = new UnlockViewModel(info.Name, password =>
{
var clientType = ClientType.Unknown;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) clientType = ClientType.AvaloniaWindows;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) clientType = ClientType.AvaloniaMac;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) clientType = ClientType.AvaloniaLinux;
account = Account.LoadFromFile(
pathToAccount: info.Path,
password: password,
currenciesProvider: AtomexApp.CurrenciesProvider,
clientType: ClientType.Unknown,
clientType: clientType,
migrationCompleteCallback: (MigrationActionType actionType) =>
{
if (actionType == MigrationActionType.XtzTransactionsDeleted)
Expand Down

0 comments on commit b9093c7

Please sign in to comment.