add setHash helper

This commit is contained in:
Kyle Shockey
2017-07-14 00:08:47 -07:00
parent 617cf7c867
commit d7f6355d85
2 changed files with 12 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
import { setHash } from "./helpers"
export const show = (ori, system) => (...args) => {
ori(...args)
try {
@@ -6,17 +8,17 @@ export const show = (ori, system) => (...args) => {
if(type === "operations-tag" || type === "operations") {
if(!shown) {
return window.location.hash = ""
return setHash("/")
}
if(type === "operations") {
let [, operationId, tag] = thing
window.location.hash = `/${tag}/${operationId}`
setHash(`/${tag}/${operationId}`)
}
if(type === "operations-tag") {
let [, tag] = thing
window.location.hash = `/${tag}`
setHash(`/${tag}`)
}
}