mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(files,files_sharing): swallow redirected navigation errors
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
a3e6ea0e83
commit
bc105e9c4a
2 changed files with 8 additions and 6 deletions
|
|
@ -38,13 +38,14 @@ Router.prototype.replace = (function(this: Router, ...args: Parameters<typeof or
|
|||
}) as typeof originalReplace
|
||||
|
||||
/**
|
||||
* Ignore duplicated-navigation error but forward real exceptions
|
||||
* Ignore duplicated- and redirected-navigation errors but forward real exceptions
|
||||
*
|
||||
* @param error The thrown error
|
||||
*/
|
||||
function ignoreDuplicateNavigation(error: unknown): void {
|
||||
if (isNavigationFailure(error, NavigationFailureType.duplicated)) {
|
||||
logger.debug('Ignoring duplicated navigation from vue-router', { error })
|
||||
if (isNavigationFailure(error, NavigationFailureType.duplicated)
|
||||
|| isNavigationFailure(error, NavigationFailureType.redirected)) {
|
||||
logger.debug('Ignoring duplicated/redirected navigation from vue-router', { error })
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,14 @@ Router.prototype.replace = (function(this: Router, ...args: Parameters<typeof or
|
|||
}) as typeof originalReplace
|
||||
|
||||
/**
|
||||
* Ignore duplicated-navigation error but forward real exceptions
|
||||
* Ignore duplicated- and redirected-navigation errors but forward real exceptions
|
||||
*
|
||||
* @param error The thrown error
|
||||
*/
|
||||
function ignoreDuplicateNavigation(error: unknown): void {
|
||||
if (isNavigationFailure(error, NavigationFailureType.duplicated)) {
|
||||
logger.debug('Ignoring duplicated navigation from vue-router', { error })
|
||||
if (isNavigationFailure(error, NavigationFailureType.duplicated)
|
||||
|| isNavigationFailure(error, NavigationFailureType.redirected)) {
|
||||
logger.debug('Ignoring duplicated/redirected navigation from vue-router', { error })
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue