@lightningjs/blits 1.43.1 → 1.43.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 +7 -1
- package/package.json +1 -1
- package/src/router/router.js +18 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.43.2
|
|
4
|
+
|
|
5
|
+
_13 Nov 2025_
|
|
6
|
+
|
|
7
|
+
- Fixed issue with endless loop in router when first page in history would fail an async before / beforeEach hook (introduced in v1.43.0)
|
|
8
|
+
|
|
3
9
|
## v1.43.1
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
_13 Nov 2025_
|
|
6
12
|
|
|
7
13
|
- Added arguments of fpsUpdate and frameTick hooks to type definitions
|
|
8
14
|
|
package/package.json
CHANGED
package/src/router/router.js
CHANGED
|
@@ -267,13 +267,15 @@ export const navigate = async function () {
|
|
|
267
267
|
} catch (error) {
|
|
268
268
|
Log.error('Error or Rejected Promise in "BeforeEach" Hook', error)
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
if (history.length > 0) {
|
|
271
|
+
preventHashChangeNavigation = true
|
|
272
|
+
currentRoute = previousRoute
|
|
273
|
+
window.history.back()
|
|
273
274
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
navigatingBack = false
|
|
276
|
+
state.navigating = false
|
|
277
|
+
return
|
|
278
|
+
}
|
|
277
279
|
}
|
|
278
280
|
// If the resolved result is an object, redirect if the path in the object was changed
|
|
279
281
|
if (isObject(beforeEachResult) === true && beforeEachResult.path !== currentPath) {
|
|
@@ -282,7 +284,7 @@ export const navigate = async function () {
|
|
|
282
284
|
return
|
|
283
285
|
}
|
|
284
286
|
// If the resolved result is false, cancel navigation
|
|
285
|
-
if (beforeEachResult === false) {
|
|
287
|
+
if (beforeEachResult === false && history.length > 0) {
|
|
286
288
|
preventHashChangeNavigation = true
|
|
287
289
|
currentRoute = previousRoute
|
|
288
290
|
window.history.back()
|
|
@@ -306,13 +308,15 @@ export const navigate = async function () {
|
|
|
306
308
|
} catch (error) {
|
|
307
309
|
Log.error('Error or Rejected Promise in "Before" Hook', error)
|
|
308
310
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
311
|
+
if (history.length > 0) {
|
|
312
|
+
preventHashChangeNavigation = true
|
|
313
|
+
currentRoute = previousRoute
|
|
314
|
+
window.history.back()
|
|
312
315
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
+
navigatingBack = false
|
|
317
|
+
state.navigating = false
|
|
318
|
+
return
|
|
319
|
+
}
|
|
316
320
|
}
|
|
317
321
|
// If the resolved result is an object, redirect if the path in the object was changed
|
|
318
322
|
if (isObject(beforeHookOutput) === true && beforeHookOutput.path !== currentPath) {
|
|
@@ -321,7 +325,7 @@ export const navigate = async function () {
|
|
|
321
325
|
return
|
|
322
326
|
}
|
|
323
327
|
// If the resolved result is false, cancel navigation
|
|
324
|
-
if (beforeHookOutput === false) {
|
|
328
|
+
if (beforeHookOutput === false && history.length > 0) {
|
|
325
329
|
preventHashChangeNavigation = true
|
|
326
330
|
currentRoute = previousRoute
|
|
327
331
|
window.history.back()
|