From 5f4e43a860e9b7f8277b6a60d99d2c8c0a7517c0 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Thu, 24 May 2018 18:39:27 +0200 Subject: [PATCH] location state params: param name is used if value is undefined --- src/js/services/RouterService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/RouterService.js b/src/js/services/RouterService.js index 72fc5a0a..c984f001 100644 --- a/src/js/services/RouterService.js +++ b/src/js/services/RouterService.js @@ -31,7 +31,7 @@ const pathToParams = (path: string): RouterLocationState => { if (urlParts.length < 1 || path === "/") return params; for (let i = 0, len = urlParts.length; i < len; i+=2) { - params[ urlParts[i] ] = urlParts[ i + 1 ]; + params[ urlParts[i] ] = urlParts[ i + 1 ] || urlParts[i]; } if (params.hasOwnProperty('device')) {