mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-23 06:25:19 -07:00
Addressed PR comments
This commit is contained in:
parent
37d287373f
commit
da52680743
1 changed files with 19 additions and 7 deletions
|
@ -60,7 +60,7 @@ bool IsGraphingModeAvailable()
|
|||
}
|
||||
|
||||
Box<bool> ^ _isGraphingModeEnabledCached = nullptr;
|
||||
bool IsGraphingModeEnabled(User ^ firstUser = nullptr)
|
||||
bool IsGraphingModeEnabled(User ^ currentUser = nullptr)
|
||||
{
|
||||
if (!IsGraphingModeAvailable())
|
||||
{
|
||||
|
@ -72,12 +72,12 @@ bool IsGraphingModeEnabled(User ^ firstUser = nullptr)
|
|||
return _isGraphingModeEnabledCached->Value;
|
||||
}
|
||||
|
||||
if (!firstUser)
|
||||
if (!currentUser)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
auto namedPolicyData = NamedPolicy::GetPolicyFromPathForUser(firstUser, L"Education", L"AllowGraphingCalculator");
|
||||
auto namedPolicyData = NamedPolicy::GetPolicyFromPathForUser(currentUser, L"Education", L"AllowGraphingCalculator");
|
||||
_isGraphingModeEnabledCached = namedPolicyData->GetBoolean() == true;
|
||||
|
||||
return _isGraphingModeEnabledCached->Value;
|
||||
|
@ -280,9 +280,21 @@ static list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||
|
||||
void NavCategory::InitializeCategoryManifest(User ^ user)
|
||||
{
|
||||
int i = 0;
|
||||
for (NavCategoryInitializer category : s_categoryManifest)
|
||||
{
|
||||
if (category.viewMode == ViewMode::Graphing)
|
||||
{
|
||||
auto navCatInit = s_categoryManifest.begin();
|
||||
std::advance(navCatInit, 2);
|
||||
std::advance(navCatInit, i);
|
||||
(*navCatInit).isEnabled = IsGraphingModeEnabled(user);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function should only be used when storing the mode to app data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue