From 6eae46e11e6c0c4198f2b9f9e6f8743e7a162a03 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Fri, 31 Jan 2025 11:01:56 +0100 Subject: [PATCH] Scene: Fix search lag on list (#2215) --- front/src/routes/scene/ScenePage.jsx | 2 +- front/src/routes/scene/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/front/src/routes/scene/ScenePage.jsx b/front/src/routes/scene/ScenePage.jsx index 6f951063dc..bf9c96d925 100644 --- a/front/src/routes/scene/ScenePage.jsx +++ b/front/src/routes/scene/ScenePage.jsx @@ -23,7 +23,7 @@ const ScenePage = ({ children, ...props }) => ( } /> diff --git a/front/src/routes/scene/index.js b/front/src/routes/scene/index.js index 1eac743498..f6d5885b0a 100644 --- a/front/src/routes/scene/index.js +++ b/front/src/routes/scene/index.js @@ -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({ @@ -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() { @@ -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}