From 7a1eaa942686ecff2bb7cedbadbb2d872ec2ec3a Mon Sep 17 00:00:00 2001 From: Tom Raithel Date: Wed, 5 Apr 2017 09:17:30 +0200 Subject: [PATCH] Fix bug in getPageNameFromPath --- README.md | 1 + js/client.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cbadaaf..250e601 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,4 @@ If an item is overwritten in a new release, the attributes from the new item are - [ ] Add mobile navigation and search - [ ] Create more react components for already existing CSS comps - [ ] Refactor hardcoded subfolder in routing +- [ ] Unit test for radar generation :see_no_evil: diff --git a/js/client.js b/js/client.js index 5e509e7..7506117 100644 --- a/js/client.js +++ b/js/client.js @@ -11,11 +11,11 @@ import {isMobileViewport} from '../common/config' // Remove .html and map / to index const getPageNameFromPath = (path) => { - if (path === path.sep) { + if (path === '/') { return 'index'; } return path.substring(1, path.length - 5); -} +}; const historyManager = store => { const history = createHistory({ @@ -37,7 +37,7 @@ const historyManager = store => { } return next(action); } -} +}; let reloadTimeout; let wasMobileViewport = isMobileViewport();