diff options
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/routing/redirect.service.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts index 571476d1d..d4cb0436e 100644 --- a/client/src/app/core/routing/redirect.service.ts +++ b/client/src/app/core/routing/redirect.service.ts | |||
@@ -46,19 +46,23 @@ export class RedirectService { | |||
46 | return this.defaultTrendingAlgorithm | 46 | return this.defaultTrendingAlgorithm |
47 | } | 47 | } |
48 | 48 | ||
49 | redirectToPreviousRoute (fallbackRoute: string[] = null) { | 49 | getPreviousUrl () { |
50 | return this.previousUrl | ||
51 | } | ||
52 | |||
53 | redirectToPreviousRoute (fallbackRoute?: string) { | ||
50 | const exceptions = [ | 54 | const exceptions = [ |
51 | '/verify-account', | 55 | '/verify-account', |
52 | '/reset-password' | 56 | '/reset-password' |
53 | ] | 57 | ] |
54 | 58 | ||
55 | if (this.previousUrl) { | 59 | if (this.previousUrl && this.previousUrl !== '/') { |
56 | const isException = exceptions.find(e => this.previousUrl.startsWith(e)) | 60 | const isException = exceptions.find(e => this.previousUrl.startsWith(e)) |
57 | if (!isException) return this.router.navigateByUrl(this.previousUrl) | 61 | if (!isException) return this.router.navigateByUrl(this.previousUrl) |
58 | } | 62 | } |
59 | 63 | ||
60 | if (fallbackRoute) { | 64 | if (fallbackRoute) { |
61 | return this.router.navigate(fallbackRoute) | 65 | return this.router.navigateByUrl(fallbackRoute) |
62 | } | 66 | } |
63 | 67 | ||
64 | return this.redirectToHomepage() | 68 | return this.redirectToHomepage() |