abstract-state-router
Advanced tools
Comparing version 7.5.1 to 7.5.2
@@ -428,4 +428,3 @@ 'use strict'; | ||
if (lastState.name && statesAreEquivalent(lastState, lastStateStartedActivating.get())) { | ||
// Check canLeaveState for all states that will be destroyed or changed | ||
const { create, destroy } = stateChangeLogic( | ||
const { destroy } = stateChangeLogic( | ||
compareStartAndEndStates({ | ||
@@ -439,6 +438,6 @@ original: lastState, | ||
); | ||
const statesNamesToCheck = Array.from(new Set([ ...create, ...destroy ]).values()); | ||
const canLeaveState = statesNamesToCheck.every(stateName => { | ||
const canLeaveStates = destroy.every(stateName => { | ||
const state = prototypalStateHolder.get(stateName); | ||
if (state?.canLeaveState && typeof state.canLeaveState === 'function') { | ||
if (state.canLeaveState && typeof state.canLeaveState === 'function') { | ||
const stateChangeAllowed = state.canLeaveState(activeDomApis[stateName]); | ||
@@ -453,6 +452,6 @@ if (!stateChangeAllowed) { | ||
if (!canLeaveState) { | ||
if (!canLeaveStates) { | ||
stateProviderEmitter.go(lastState.name, lastState.parameters, { replace: true }); | ||
} | ||
return canLeaveState | ||
return canLeaveStates | ||
} | ||
@@ -459,0 +458,0 @@ return true |
{ | ||
"name": "abstract-state-router", | ||
"version": "7.5.1", | ||
"version": "7.5.2", | ||
"description": "Like ui-router, but without all the Angular. The best way to structure a single-page webapp.", | ||
@@ -5,0 +5,0 @@ "main": "bundle.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91134
600