Skip to content

Commit 96206dd

Browse files
authored
Merge pull request #59842 from nextcloud/fix/swallow-redirected-navigation
fix(files,files_sharing): swallow redirected navigation errors
2 parents 0761693 + ed7223b commit 96206dd

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

apps/files/src/router/router.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ Router.prototype.replace = (function(this: Router, ...args: Parameters<typeof or
3838
}) as typeof originalReplace
3939

4040
/**
41-
* Ignore duplicated-navigation error but forward real exceptions
41+
* Ignore duplicated- and redirected-navigation errors but forward real exceptions
4242
*
4343
* @param error The thrown error
4444
*/
4545
function ignoreDuplicateNavigation(error: unknown): void {
46-
if (isNavigationFailure(error, NavigationFailureType.duplicated)) {
47-
logger.debug('Ignoring duplicated navigation from vue-router', { error })
46+
if (isNavigationFailure(error, NavigationFailureType.duplicated)
47+
|| isNavigationFailure(error, NavigationFailureType.redirected)) {
48+
logger.debug('Ignoring duplicated/redirected navigation from vue-router', { error })
4849
} else {
4950
throw error
5051
}

apps/files_sharing/src/router/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ Router.prototype.replace = (function(this: Router, ...args: Parameters<typeof or
3434
}) as typeof originalReplace
3535

3636
/**
37-
* Ignore duplicated-navigation error but forward real exceptions
37+
* Ignore duplicated- and redirected-navigation errors but forward real exceptions
3838
*
3939
* @param error The thrown error
4040
*/
4141
function ignoreDuplicateNavigation(error: unknown): void {
42-
if (isNavigationFailure(error, NavigationFailureType.duplicated)) {
43-
logger.debug('Ignoring duplicated navigation from vue-router', { error })
42+
if (isNavigationFailure(error, NavigationFailureType.duplicated)
43+
|| isNavigationFailure(error, NavigationFailureType.redirected)) {
44+
logger.debug('Ignoring duplicated/redirected navigation from vue-router', { error })
4445
} else {
4546
throw error
4647
}

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-init-public.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-init-public.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)