From 4ef9c875d51846c47cbc555d58f1b1ae45b6ffa8 Mon Sep 17 00:00:00 2001 From: YishaiGlasner Date: Mon, 28 Oct 2024 13:45:55 +0200 Subject: [PATCH] fix(ConnectionsPanel): set data in advanced state (for checking the ability to edit text). --- static/js/ReaderPanel.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/ReaderPanel.jsx b/static/js/ReaderPanel.jsx index 623e6ff3fc..8640f6ac2f 100644 --- a/static/js/ReaderPanel.jsx +++ b/static/js/ReaderPanel.jsx @@ -61,7 +61,7 @@ class ReaderPanel extends Component { } conditionalSetTextData() { this.setState({data: null}); - if (this.state.mode === "Text" || this.state.mode === "TextAndConnections") { + if (this.state.mode === "Text" || this.state.mode === "TextAndConnections" || this.state.connectionsMode === 'Advanced Tools') { const ref = this.state.currentlyVisibleRef; Sefaria.getTextFromCurrVersions(ref, this.state.currVersions, this.props.translationLanguagePreference, true).then(data => { this.setState({data: data}); @@ -102,7 +102,8 @@ class ReaderPanel extends Component { $(".readerOptionsPanel").find('.on:focusable').first().focus(); } if (!Sefaria.areBothVersionsEqual(prevState.currVersions, this.state.currVersions) || - this.state.currentlyVisibleRef !== prevState.currentlyVisibleRef) { + this.state.currentlyVisibleRef !== prevState.currentlyVisibleRef || + this.state.connectionsMode !== prevState.connectionsMode) { this.conditionalSetTextData(); } if (this.shouldLayoutUpdate(prevState)) {