Skip to content

Commit

Permalink
#10 Config issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
iXab3r committed Mar 24, 2017
1 parent 0362bd4 commit c516b83
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions PoeEye/PoeEye/PoeTrade/ViewModels/PoeMainSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ namespace PoeEye.PoeTrade.ViewModels
internal sealed class PoeMainSettingsViewModel : DisposableReactiveObject, ISettingsViewModel<PoeEyeMainConfig>
{
private bool clipboardMonitoringEnabled;

private EditableTuple<string, float>[] currenciesPriceInChaosOrbs = new EditableTuple<string, float>[0];

private bool isOpen;

private bool whisperNotificationsEnabled;

private PoeEyeTabConfig[] tabConfigs;
private PoeEyeMainConfig loadedConfig;

public bool IsOpen
{
Expand Down Expand Up @@ -48,6 +45,8 @@ public bool ClipboardMonitoringEnabled

public void Load(PoeEyeMainConfig config)
{
loadedConfig = config;

tabConfigs = config.TabConfigs;
ClipboardMonitoringEnabled = config.ClipboardMonitoringEnabled;
WhisperNotificationsEnabled = config.WhisperNotificationsEnabled;
Expand All @@ -59,15 +58,11 @@ public void Load(PoeEyeMainConfig config)

public PoeEyeMainConfig Save()
{
var config = new PoeEyeMainConfig()
{
TabConfigs = tabConfigs,
ClipboardMonitoringEnabled = ClipboardMonitoringEnabled,
WhisperNotificationsEnabled = WhisperNotificationsEnabled,
CurrenciesPriceInChaos = CurrenciesPriceInChaosOrbs.ToDictionary(x => x.Item1, x => x.Item2),
};

return config;
loadedConfig.TabConfigs = tabConfigs;
loadedConfig.ClipboardMonitoringEnabled = ClipboardMonitoringEnabled;
loadedConfig.WhisperNotificationsEnabled = WhisperNotificationsEnabled;
loadedConfig.CurrenciesPriceInChaos = CurrenciesPriceInChaosOrbs.ToDictionary(x => x.Item1, x => x.Item2);
return loadedConfig;
}
}
}

0 comments on commit c516b83

Please sign in to comment.