From 0c1c037a51db49fb92e5f205e02683a8b20ba506 Mon Sep 17 00:00:00 2001 From: esikkala <esko.ikkala@aalto.fi> Date: Thu, 8 Aug 2019 17:13:16 +0300 Subject: [PATCH] Fix perspective tab values --- src/client/components/main_layout/PerspectiveTabs.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/components/main_layout/PerspectiveTabs.js b/src/client/components/main_layout/PerspectiveTabs.js index 70bca388..563ffbc6 100644 --- a/src/client/components/main_layout/PerspectiveTabs.js +++ b/src/client/components/main_layout/PerspectiveTabs.js @@ -36,7 +36,14 @@ class PerspectiveTabs extends React.Component { } pathnameToValue = pathname => { - return has(this.props.tabs, pathname) ? this.props.tabs[pathname].value : 0; + const activeID = pathname.split('/').pop(); + let value = 0; + this.props.tabs.map(tab => { + if (tab.id == activeID) { + value = tab.value; + } + }); + return value; } renderIcon = iconString => { -- GitLab