Skip to content

Commit

Permalink
Clear search
Browse files Browse the repository at this point in the history
  • Loading branch information
benbucksch committed Jan 13, 2025
1 parent 754dd6e commit aa05317
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/frontend/Mail/LeftPane/LeftPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PersonsList persons={appGlobal.persons} bind:selected={$selectedPerson} size="small" />
<ViewSwitcher />
{:else if activeTab == SearchView.Search}
<SearchPane bind:searchMessages on:clear={onClearSearch} />
<SearchPane bind:searchMessages on:clear={onEndSearchMode} />
{:else}
<!--<ProjectList />-->
<AccountList {accounts} bind:selectedAccount />
Expand Down Expand Up @@ -66,17 +66,18 @@
function openSearchPane() {
activeTab = SearchView.Search;
}
$: if (activeTab != SearchView.Search) clearSearchMessages();
$: activeTab, clearSearchMessages();
function clearSearchMessages() {
searchMessages = null;
lastPerson = null;
}
// Search.svelte is removed here above, and therefore cannot react anymore, so have to do it here.
// Reproduction: window title | search field | (x) button
$: if (!$globalSearchTerm) onClearSearch();
function onClearSearch() {
$: if (!$globalSearchTerm) onEndSearchMode();
function onEndSearchMode() {
activeTab = SearchView.Folder;
clearSearchMessages();
}
let lastPerson: Person;
Expand Down

0 comments on commit aa05317

Please sign in to comment.