Skip to content

Commit 09ec817

Browse files
author
Raphaël Balet
committed
pref(service): back logic
1 parent 3f343c0 commit 09ec817

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

projects/ngx-back-button/src/lib/ngx-back-button.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ export class NgxBackButtonService {
2828
}
2929

3030
back(fallback?: string): void {
31-
fallback = this._fallbackPrefix + (fallback || this._rootUrl)
32-
3331
const record = this._history.pop()
3432

3533
if (this._history.length > 0) {
3634
this._location.back()
3735
} else {
3836
try {
39-
window.history.replaceState(null, '', fallback)
37+
window.history.replaceState(null, '', this._fallbackPrefix + (fallback || this._rootUrl))
4038
} catch (error) {
4139
console.error('NgxBackButton: ' + error)
4240
}

0 commit comments

Comments
 (0)