Remove m_is_firstTime

This commit is contained in:
Seulgi Kim 2019-04-14 18:09:03 -07:00
commit f049b4a3ee

View file

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. // Licensed under the MIT License.
#include "pch.h" #include "pch.h"
@ -147,7 +147,6 @@ UnitConverterViewModel::UnitConverterViewModel(const shared_ptr<UCM::IUnitConver
Unit2AutomationName = m_localizedOutputUnitName; Unit2AutomationName = m_localizedOutputUnitName;
IsDecimalEnabled = true; IsDecimalEnabled = true;
m_IsFirstTime = true;
m_model->Initialize(); m_model->Initialize();
PopulateData(); PopulateData();
} }
@ -155,7 +154,6 @@ UnitConverterViewModel::UnitConverterViewModel(const shared_ptr<UCM::IUnitConver
void UnitConverterViewModel::ResetView() void UnitConverterViewModel::ResetView()
{ {
m_model->SendCommand(UCM::Command::Reset); m_model->SendCommand(UCM::Command::Reset);
m_IsFirstTime = true;
OnCategoryChanged(nullptr); OnCategoryChanged(nullptr);
} }
@ -234,16 +232,9 @@ void UnitConverterViewModel::OnUnitChanged(Object^ parameter)
// End timer to show results immediately // End timer to show results immediately
m_supplementaryResultsTimer->Cancel(); m_supplementaryResultsTimer->Cancel();
} }
if (!m_IsFirstTime)
{
SaveUserPreferences(); SaveUserPreferences();
} }
else
{
RestoreUserPreferences();
m_IsFirstTime = false;
}
}
void UnitConverterViewModel::OnSwitchActive(Platform::Object^ unused) void UnitConverterViewModel::OnSwitchActive(Platform::Object^ unused)
{ {