Add max search history
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user