From 52dbcfe8529f6d725d6868875f46f71cd17fe4b6 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 20 Feb 2021 18:01:45 -0800 Subject: [PATCH] Fixed: Queue refresh closing manual import from queue if items change (cherry picked from commit e9818b9982d868648d714a37527f1b066486c5df) --- frontend/src/Activity/Queue/Queue.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/Activity/Queue/Queue.js b/frontend/src/Activity/Queue/Queue.js index bb974227e..1af913756 100644 --- a/frontend/src/Activity/Queue/Queue.js +++ b/frontend/src/Activity/Queue/Queue.js @@ -45,12 +45,8 @@ class Queue extends Component { }; } - shouldComponentUpdate(nextProps) { - if (!this._shouldBlockRefresh) { - return true; - } - - if (hasDifferentItems(this.props.items, nextProps.items)) { + shouldComponentUpdate() { + if (this._shouldBlockRefresh) { return false; } @@ -123,14 +119,14 @@ class Queue extends Component { } onRemoveSelectedConfirmed = (payload) => { + this._shouldBlockRefresh = false; this.props.onRemoveSelectedPress({ ids: this.getSelectedIds(), ...payload }); this.setState({ isConfirmRemoveModalOpen: false }); - this._shouldBlockRefresh = false; } onConfirmRemoveModalClose = () => { - this.setState({ isConfirmRemoveModalOpen: false }); this._shouldBlockRefresh = false; + this.setState({ isConfirmRemoveModalOpen: false }); } //