mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-30 00:44:20 +03:00
Adjust querystring updater
This commit is contained in:
parent
462ea34f40
commit
34f3793476
@ -195,11 +195,13 @@ export class SlideDeck extends React.Component {
|
||||
return
|
||||
}
|
||||
const { index, mode, step } = this.state
|
||||
let query = '?'
|
||||
if (mode !== modes.normal) {
|
||||
query += querystring.stringify({
|
||||
let query = ''
|
||||
if (mode && mode !== modes.normal) {
|
||||
query += '?' + querystring.stringify({
|
||||
mode: (mode || '').toLowerCase()
|
||||
})
|
||||
} else if (mode === modes.normal) {
|
||||
query += '/'
|
||||
}
|
||||
const step_ = step !== -1 ? ('.' + (step + 1)) : ''
|
||||
history.pushState(null, null, query + '#' + index + step_)
|
||||
|
Loading…
Reference in New Issue
Block a user