Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
previous(e) {
if (e) {
e.stopPropagation()
}
const currentIndex = this.findCurrentIndex()
if (currentIndex || currentIndex === 0) {
let previousPost
// Wrap around if at start.
if (currentIndex === 0) {
previousPost = posts.slice(-1)[0]
} else {
previousPost = posts[currentIndex - 1]
}
push(`/${previousPost.id}/`)
}
}
next(e) {
if (e) {
e.stopPropagation()
}
const currentIndex = this.findCurrentIndex()
if (currentIndex || currentIndex === 0) {
let nextPost
// Wrap around if at end.
if (currentIndex + 1 === posts.length) {
nextPost = posts[0]
} else {
nextPost = posts[currentIndex + 1]
}
push(`/${nextPost.id}/`)
}
}
yield call(() => {
push(path);
});
}
logout(() => push('/'));
},
changeDocs(event: SyntheticEvent) {
const pageTarget = {
bitbox: '/bitbox/docs/getting-started',
badger: '/badger/docs/getting-started',
gui: '/gui/docs/getting-started',
rest: '/rest/docs/getting-started',
slp: '/slp/docs/js/getting-started',
cashscript: '/cashscript/docs/getting-started',
}[event.target.value]
pageTarget && push(pageTarget)
}