@dreamworld/web-util
Advanced tools
Comparing version 1.5.1-development.1 to 1.5.1
@@ -70,3 +70,3 @@ import lastIndexOf from "lodash-es/lastIndexOf"; | ||
*/ | ||
export const navigate = (url, { replace, autoBack, title = "", state = {} }) => { | ||
export const navigate = (url, { replace, autoBack, autoBackCount, title = "", state = {} }) => { | ||
if (!url) { | ||
@@ -77,4 +77,4 @@ console.warn("Router:navigate(): url is not provided"); | ||
if(autoBack) { | ||
const count = getBackCount(url); | ||
if(autoBack && autoBackCount) { | ||
const count = getBackCount(url, autoBackCount); | ||
if(count) { | ||
@@ -104,3 +104,2 @@ go(-count); | ||
const currentPageIndex = getCurrentPageIndex(); | ||
console.log('web util history called', currentPageIndex); | ||
if (!currentPageIndex && fallbackCallback) { | ||
@@ -174,3 +173,3 @@ fallbackCallback(); | ||
*/ | ||
export const getBackCount = (url) => { | ||
export const getBackCount = (url, autoBackCount) => { | ||
if(!url) { | ||
@@ -184,3 +183,4 @@ return 0; | ||
const urlIndex = lastIndexOf(historyList, getRelativeUrl(url)); | ||
return urlIndex >= 0 && urlIndex !== undefined ? (historyList.length - 1) - urlIndex: 0; | ||
const count = urlIndex >= 0 && urlIndex !== undefined ? (historyList.length - 1) - urlIndex: 0; | ||
return autoBackCount && autoBackCount >= count ? count: 0; | ||
} | ||
@@ -187,0 +187,0 @@ |
{ | ||
"name": "@dreamworld/web-util", | ||
"version": "1.5.1-development.1", | ||
"version": "1.5.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
24316
1