Closed paul-tqh-nguyen closed 5 years ago
There's a synchronization issue that necessitates delaying the start of our header row's animations to make sure everything's in sync.
See this code in arxiv_as_a_newspaper/front_end/src/Components/HeaderRow.js:
arxiv_as_a_newspaper/front_end/src/Components/HeaderRow.js
updateCurrentlyShownResearchFields() { let { firstShownResearchFieldIndex } = this.state; let { researchFields } = this.props; let maxIndex = researchFields.length; let updatedFirstShownResearchFieldIndex = firstShownResearchFieldIndex+numShownHeaderRowLinks; if (updatedFirstShownResearchFieldIndex >= maxIndex) { updatedFirstShownResearchFieldIndex = 0; } let lastShownResearchFieldIndex = Math.min(maxIndex, updatedFirstShownResearchFieldIndex+numShownHeaderRowLinks); this.setState({ firstShownResearchFieldIndex: updatedFirstShownResearchFieldIndex, currentlyShownResearchFields: researchFields.slice(updatedFirstShownResearchFieldIndex, lastShownResearchFieldIndex) }); } initializeHeaderRowResearchFieldLoopingInterval() { this.headerRowResearchFieldLoopingInterval = setInterval(() => {this.updateCurrentlyShownResearchFields();}, numMillisecondsBetweenHeaderRowUpdates); } componentDidMount() { this.headerRowResearchFieldLoopingIntervalDelayer = setTimeout(() => { this.updateCurrentlyShownResearchFields(); this.initializeHeaderRowResearchFieldLoopingInterval(); }, numMillisecondsToWaitPriorToInitializingHeaderRowRotations); }
Let's fix the underlying issue.
https://github.com/paul-tqh-nguyen/arxiv_as_a_newspaper/commit/ae57eb7a869c1367c83c919ca8bc6a5aaf6e2c06 This patch made the sync issue go away.
Let's reopen this issue if the problem reappears.
There's a synchronization issue that necessitates delaying the start of our header row's animations to make sure everything's in sync.
See this code in
arxiv_as_a_newspaper/front_end/src/Components/HeaderRow.js
:Let's fix the underlying issue.