@lightningjs/blits 1.23.1 → 1.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/router/router.js +7 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/router/router.js
CHANGED
|
@@ -328,15 +328,19 @@ const removeView = async (route, view, transition) => {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
// cache the page when it's as 'keepAlive' instead of destroying
|
|
331
|
-
if (route.options && route.options.keepAlive === true
|
|
331
|
+
if (navigatingBack === false && route.options && route.options.keepAlive === true) {
|
|
332
332
|
cacheMap.set(route.hash, { view: view, focus: previousFocus })
|
|
333
333
|
} else if (navigatingBack === true) {
|
|
334
334
|
// remove the previous route from the cache when navigating back
|
|
335
335
|
// cacheMap.delete will not throw an error if the route is not in the cache
|
|
336
336
|
cacheMap.delete(route.hash)
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
/* Destroy the view in the following cases:
|
|
339
|
+
* 1. Navigating forward, and the previous route is not configured with "keep alive" set to true.
|
|
340
|
+
* 2. Navigating back, and the previous route is configured with "keep alive" set to true.
|
|
341
|
+
* 3. Navigating back, and the previous route is not configured with "keep alive" set to true.
|
|
342
|
+
*/
|
|
343
|
+
if (route.options && (route.options.keepAlive !== true || navigatingBack === true)) {
|
|
340
344
|
view.destroy()
|
|
341
345
|
view = null
|
|
342
346
|
}
|