Repository: microsoft/terminal
File: src/cascadia/TerminalApp/TerminalPage.cpp (C++)

Code before:
    {
        auto strongThis = get_strong();
        auto now{ std::chrono::system_clock::now() };
        if (now - _lastUpdateCheck < std::chrono::days{ 1 })
        {
            co_return;
        }
        _lastUpdateCheck = now;

        if (!IsPackaged())
        {
            co_return;
        }

        co_await wil::resume_foreground(strongThis->_tabView.Dispatcher());
        _SetPendingUpdateVersion({});
        CheckingForUpdates(true);

        try
        {
#ifdef WT_BRANDING_DEV
            co_await winrt::resume_after(std::chrono::seconds{ 3 });
            co_await wil::resume_foreground(strongThis->_tabView.Dispatcher());
            _SetPendingUpdateVersion(L"X.Y.Z");
#else // release build, likely has a store context
            auto storeContext = winrt::Windows::Services::Store::StoreContext::GetDefault();
            auto updates = co_await storeContext.GetAppAndOptionalStorePackageUpdatesAsync();
            co_await wil::resume_foreground(strongThis->_tabView.Dispatcher());
            if (updates.Size() > 0)
            {
                auto version = updates.GetAt(0).Package().Id().Version();
                _SetPendingUpdateVersion(fmt::format(L"{0}.{1}.{2}", version.Major, version.Minor, version.Revision));
            }
#endif
        }
        catch (...)
        {
            // do nothing on failure
        }

        co_await wil::resume_foreground(strongThis->_tabView.Dispatcher());
        CheckingForUpdates(false);
    }

    // Method Description:
    // - Show a dialog with "About" information. Displays the app's Display
    //   Name, version, getting started link, documentation link, release
    //   Notes link, and privacy policy link.
    void TerminalPage::_ShowAboutDialog()
    {
        _QueueUpdateCheck();

Review comment (suggestion):
presumably
```suggestion
            if(auto storeContext = winrt::Windows::Services::Store::StoreContext::GetDefault())
            {
```

and wrap up the rest of this as a conditional

Code after:
        // recursive helper function. This returns a std::vector of FlyoutItemBases,
        // that we then add to our Flyout.
        auto entries = _settings.GlobalSettings().NewTabMenu();
        auto items = _CreateNewTabFlyoutItems(entries);
        for (const auto& item : items)
        {
            newTabFlyout.Items().Append(item);
        }

        // add menu separator
        auto separatorItem = WUX::Controls::MenuFlyoutSeparator{};
        newTabFlyout.Items().Append(separatorItem);

        // add static items
        {
            // GH#2455 - Make sure to try/catch calls to Application::Current,
            // because that _won't_ be an instance of TerminalApp::App in the
            // LocalTests
            auto isUwp = false;
            try
            {
                isUwp = ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::TerminalApp::App>().Logic().IsUwp();
            }
            CATCH_LOG();

            if (!isUwp)
            {
                // Create the settings button.
                auto settingsItem = WUX::Controls::MenuFlyoutItem{};
                settingsItem.Text(RS_(L"SettingsMenuItem"));
                const auto settingsToolTip = RS_(L"SettingsToolTip");

                WUX::Controls::ToolTipService::SetToolTip(settingsItem, box_value(settingsToolTip));
                Automation::AutomationProperties::SetHelpText(settingsItem, settingsToolTip);

                WUX::Controls::SymbolIcon ico{};
                ico.Symbol(WUX::Controls::Symbol::Setting);
                settingsItem.Icon(ico);

                settingsItem.Click({ this, &TerminalPage::_SettingsButtonOnClick });
                newTabFlyout.Items().Append(settingsItem);

                auto actionMap = _settings.ActionMap();
                const auto settingsKeyChord{ actionMap.GetKeyBindingForAction(ShortcutAction::OpenSettings, OpenSettingsArgs{ SettingsTarget::SettingsUI }) };
                if (settingsKeyChord)
                {
                    _SetAcceleratorForMenuItem(settingsItem, settingsKeyChord);
                }

                // Create the command palette button.
                auto commandPaletteFlyout = WUX::Controls::MenuFlyoutItem{};