diff --git a/src/store/modules/navigation.js b/src/store/modules/navigation.js
index <HASH>..<HASH> 100644
--- a/src/store/modules/navigation.js
+++ b/src/store/modules/navigation.js
@@ -19,9 +19,14 @@ function transformViewName (view) {
 }
 function newIDGen (view, viewPosition) {
   let ID = ''
-  if (viewPosition === 'previous') store.state.cache[store.state.cache.length - 1].id.split('--')
-  if (viewPosition === 'past') store.state.cache[store.state.cache.length - 2].id.split('--')
-  if (viewPosition === 'last') store.state.cache[store.state.cache.length - 3].id.split('--')
+  if (viewPosition === 'previous') {
+    var index = 1
+  } else if (viewPosition === 'past') {
+    index = 2
+  } else {
+    index = 3
+  }
+  store.state.cache[store.state.cache.length - index].id.split('--')
   view === viewPosition[0] ? ID = view + '--' + (Number(viewPosition[1]) + 1) : ID = view + '--0'
   return ID
 }
Simplify code for TransformViewName