return this.defaultRoute
}
-
getDefaultTrendingAlgorithm () {
return this.defaultTrendingAlgorithm
}
- redirectToPreviousRoute () {
+ getPreviousUrl () {
+ return this.previousUrl
+ }
+
+ redirectToPreviousRoute (fallbackRoute?: string) {
const exceptions = [
'/verify-account',
'/reset-password'
]
- if (this.previousUrl) {
+ if (this.previousUrl && this.previousUrl !== '/') {
const isException = exceptions.find(e => this.previousUrl.startsWith(e))
if (!isException) return this.router.navigateByUrl(this.previousUrl)
}
+ if (fallbackRoute) {
+ return this.router.navigateByUrl(fallbackRoute)
+ }
+
return this.redirectToHomepage()
}