fix pasting in search bar after page load showing no results

This commit is contained in:
undergroundwires
2020-09-16 01:59:11 +01:00
parent 6efed72bf2
commit d169434157
6 changed files with 156 additions and 118 deletions

View File

@@ -49,6 +49,7 @@
state.filter.filtered.on(this.handleFiltered);
// Update initial state
await this.initializeNodesAsync(this.categoryId);
await this.initializeFilter(state.filter.currentFilter);
}
public async toggleNodeSelectionAsync(event: INodeSelectedEvent) {
@@ -84,6 +85,14 @@
(category: ICategory) => node.id === getCategoryNodeId(category));
}
private initializeFilter(currentFilter: IFilterResult | undefined) {
if (!currentFilter) {
this.handleFilterRemoved();
} else {
this.handleFiltered(currentFilter);
}
}
private handleSelectionChanged(selectedScripts: ReadonlyArray<SelectedScript>): void {
this.selectedNodeIds = selectedScripts
.map((node) => node.id);