Replace spaces with underscores when setting the hash value and inserting the ID into the DOM. Escape the deep link path when querying for the DOM element on hash change.

This commit is contained in:
Owen Conti
2017-09-13 21:32:46 -06:00
parent 16364fb81e
commit a6e070ac76
5 changed files with 14 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import { setHash } from "./helpers"
import { createDeepLinkPath } from "core/utils"
export const show = (ori, { getConfigs }) => (...args) => {
ori(...args)
@@ -19,12 +20,12 @@ export const show = (ori, { getConfigs }) => (...args) => {
if(type === "operations") {
let [, tag, operationId] = thing
setHash(`/${tag}/${operationId}`)
setHash(`/${createDeepLinkPath(tag)}/${createDeepLinkPath(operationId)}`)
}
if(type === "operations-tag") {
let [, tag] = thing
setHash(`/${tag}`)
setHash(`/${createDeepLinkPath(tag)}`)
}
}