FIX: Give the topic timeline unique keys for state

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.
This commit is contained in:
Robin Ward 2021-09-10 12:36:01 -04:00
parent 299d0ca445
commit b246a63a59
1 changed files with 2 additions and 2 deletions

View File

@ -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` };
@ -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 };