Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
FIX: Give the topic timeline unique keys for state
Browse files Browse the repository at this point in the history
We've observed an error where the back button is displayed improperly in
the topic timeline. It's unfortunately been hard to reproduce but we
suspect it's related to leftover state when re-rendering.

This fix optimistically tries to fix the error by introducing the
topic's id to the unique key the widgets use for state. We can deploy
this and keep an eye out for the bug in the future.
  • Loading branch information
eviltrout committed Sep 10, 2021
1 parent 299d0ca commit b246a63
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ createWidget("timeline-padding", {

createWidget("timeline-scrollarea", {
tagName: "div.timeline-scrollarea",
buildKey: () => `timeline-scrollarea`,
buildKey: (attrs) => `timeline-scrollarea-${attrs.topic.id}`,

buildAttributes() {
return { style: `height: ${scrollareaHeight()}px` };
Expand Down Expand Up @@ -411,7 +411,7 @@ createWidget("timeline-footer-controls", {
export default createWidget("topic-timeline", {
tagName: "div.topic-timeline",

buildKey: () => "topic-timeline-area",
buildKey: (attrs) => `topic-timeline-area-${attrs.topic.id}`,

defaultState() {
return { position: null, excerpt: null };
Expand Down

0 comments on commit b246a63

Please sign in to comment.