Skip to content

Commit

Permalink
Scene: Fix search lag on list (#2215)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles authored Jan 31, 2025
1 parent f947056 commit 6eae46e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion front/src/routes/scene/ScenePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ScenePage = ({ children, ...props }) => (
<CardFilter
changeOrderDir={props.changeOrderDir}
orderValue={props.getScenesOrderDir}
search={props.debouncedSearch}
search={props.search}
searchValue={props.sceneSearch}
searchPlaceHolder={<Text id="scene.searchPlaceholder" />}
/>
Expand Down
6 changes: 3 additions & 3 deletions front/src/routes/scene/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Scene extends Component {
sceneSearch: e.target.value
});
this.updateURL();
await this.getScenes();
await this.debouncedGetScenes();
};
searchTags = async tags => {
await this.setState({
Expand Down Expand Up @@ -127,7 +127,7 @@ class Scene extends Component {
sceneTagSearch: urlParams.getAll('tags') || [],
loading: true
};
this.debouncedSearch = debounce(this.search.bind(this), 200);
this.debouncedGetScenes = debounce(this.getScenes.bind(this), 200);
}

componentWillMount() {
Expand All @@ -143,7 +143,7 @@ class Scene extends Component {
scenes={scenes}
getError={getError}
loading={loading}
debouncedSearch={this.debouncedSearch}
search={this.search}
changeOrderDir={this.changeOrderDir}
switchActiveScene={this.switchActiveScene}
tags={tags}
Expand Down

0 comments on commit 6eae46e

Please sign in to comment.