Add max search history

This commit is contained in:
WardPearce
2025-01-24 17:32:47 +13:00
parent 422e4d523d
commit cb9a1ee7a7
4 changed files with 28 additions and 3 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ export class ElectronCapacitorApp {
defaultHeight: 800,
});
// Setup preload script path and construct our main window.
const preloadPath = join(app.getAppPath(), 'build', 'src', 'preload);
const preloadPath = join(app.getAppPath(), 'build', 'src', 'preload.js');
this.MainWindow = new BrowserWindow({
icon,
show: false,
@@ -46,7 +46,11 @@
showSearchBox = false;
if ($interfaceSearchHistoryEnabled && !$searchHistoryStore.includes(search)) {
searchHistoryStore.set([search, ...$searchHistoryStore]);
let pastHistory = $searchHistoryStore;
if (pastHistory.length > 15) {
pastHistory.pop();
}
searchHistoryStore.set([search, ...pastHistory]);
}
}
@@ -24,7 +24,9 @@
interfaceLowBandwidthMode,
interfacePreviewVideoOnHoverStore,
interfaceRegionStore,
interfaceSearchHistoryEnabled,
interfaceSearchSuggestionsStore,
searchHistoryStore,
themeColorStore
} from '../../store';
@@ -128,6 +130,25 @@
</nav>
</div>
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
<div>{$_('layout.searchHistory')}</div>
</div>
<label class="switch">
<input
type="checkbox"
bind:checked={$interfaceSearchHistoryEnabled}
on:click={() => {
interfaceSearchHistoryEnabled.set(!$interfaceSearchHistoryEnabled);
searchHistoryStore.set([]);
}}
/>
<span></span>
</label>
</nav>
</div>
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
+1 -1
View File
@@ -106,7 +106,7 @@
"logout": "Logout",
"customize": "Customize",
"lowBandwidthMode": "Low bandwidth mode",
"displayThumbnailAvatars": "Display channel avatars on thumbnail (Slow)",
"displayThumbnailAvatars": "Thumbnail avatars (Slow)",
"searchHistory": "Search history",
"theme": {
"theme": "Theme",