Closed cr04ch closed 11 months ago
Thanks for reporting, that is weird.
I verified that setExpandedEntries
is being called with {}
as an argument but for some reason the state
is not updated, even though it is passed to setState
:
I'm not a programmer, so I can't find the root of the issue, but if I make the following changes to work around the problem, the function works for me.
diff -Nadur a/client/js/templates/EntriesPage.jsx b/client/js/templates/EntriesPage.jsx
--- a/client/js/templates/EntriesPage.jsx 2023-07-17 17:09:47.258946668 +0200
+++ b/client/js/templates/EntriesPage.jsx 2023-07-27 08:42:11.668197075 +0200
@@ -571,14 +571,14 @@
* @param {number} id of entry
*/
activateEntry(id) {
- if (this.props.configuration.autoCollapse) {
- this.collapseAllEntries();
- }
-
this.setSelectedEntry(id);
// show/hide (with toolbar)
- this.setEntryExpanded(id, true);
+ if (this.props.configuration.autoCollapse) {
+ this.setExpandedEntries({[id]: true});
+ } else {
+ this.setEntryExpanded(id, true);
+ }
// automark as read
const entry = this.state.entries.find((entry) => id === entry.id);
Thanks. Your patch is correct, though the original code should work as well – turns out you discovered a pretty nasty logic bug that got revealed when we upgraded to React 18 recently. https://github.com/fossar/selfoss/pull/1458 should fix it.
My
config.ini
has the optionauto_collapse=1
, but the previously expanded elements do not collapse when I click on a new element.2.20-8307769
115.0.2
115.0.5790.102