Skip to content

Commit

Permalink
fix read issue that caused double navigations fixes hakimel#3079
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel authored and stefanocampanella committed Mar 1, 2022
1 parent eea9443 commit 463f798
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions js/controllers/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ export default class Location {
const currentIndices = this.Reveal.getIndices();
const newIndices = this.getIndicesFromHash();

if( newIndices && ( newIndices.h !== currentIndices.h || newIndices.v !== currentIndices.v || newIndices.f !== undefined ) ) {
this.Reveal.slide( newIndices.h, newIndices.v, newIndices.f );
if( newIndices ) {
if( ( newIndices.h !== currentIndices.h || newIndices.v !== currentIndices.v || newIndices.f !== undefined ) ) {
this.Reveal.slide( newIndices.h, newIndices.v, newIndices.f );
}
}
// If no new indices are available, we're trying to navigate to
// a slide hash that does not exist
else {
this.Reveal.slide( currentIndices.h || 0, currentIndices.v || 0 );
}
Expand Down

0 comments on commit 463f798

Please sign in to comment.