Update URL fragment when operations & tags are shown or hidden

This commit is contained in:
Kyle Shockey
2017-07-13 23:24:19 -07:00
parent c051952081
commit 617cf7c867
4 changed files with 49 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
export const show = (ori, system) => (...args) => {
ori(...args)
try {
let [thing, shown] = args
let [type] = thing
if(type === "operations-tag" || type === "operations") {
if(!shown) {
return window.location.hash = ""
}
if(type === "operations") {
let [, operationId, tag] = thing
window.location.hash = `/${tag}/${operationId}`
}
if(type === "operations-tag") {
let [, tag] = thing
window.location.hash = `/${tag}`
}
}
} catch(e) {
// This functionality is not mission critical, so if something goes wrong
// we'll just move on
console.error(e)
}
}