From 2255106a784ddab506f34267aa59a7a90e20361b Mon Sep 17 00:00:00 2001 From: Heiko <61519853+htcfreek@users.noreply.github.com> Date: Mon, 16 Jun 2025 10:46:51 +0200 Subject: [PATCH] [CmdPal > Time&Date] Fix outdated result (#40050) ## Summary of the Pull Request The results in Time&Date ext are cached. This leads to outdated results and makes no sense for a time/date query. The PR fixes this. ## PR Checklist - [x] **Closes:** #39973 - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed --- .../Pages/TimeDateExtensionPage.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs index 024a559087..8dce2128ce 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs @@ -18,8 +18,6 @@ internal sealed partial class TimeDateExtensionPage : DynamicListPage private IList _results = new List(); - private bool initialized; - private SettingsManager _settingsManager; public TimeDateExtensionPage(SettingsManager settingsManager) @@ -35,12 +33,9 @@ internal sealed partial class TimeDateExtensionPage : DynamicListPage public override IListItem[] GetItems() { - if (!initialized) - { - DoExecuteSearch(string.Empty); - } + DoExecuteSearch(string.Empty); - lock (_resultsLock) + lock (_resultsLock) { ListItem[] results = _results.ToArray(); return results; @@ -49,11 +44,6 @@ internal sealed partial class TimeDateExtensionPage : DynamicListPage public override void UpdateSearchText(string oldSearch, string newSearch) { - if (newSearch == oldSearch) - { - return; - } - DoExecuteSearch(newSearch); } @@ -84,7 +74,6 @@ internal sealed partial class TimeDateExtensionPage : DynamicListPage { lock (_resultsLock) { - initialized = true; this._results = result; }