Is there any way to preserve the history of your actions on the app?
Here is a basic flow of my app:
search.page.ts
find some recordsresult.page.ts
go to record viewcase.page.ts
from record view navigate to a case this record is linked toresult.page.ts
from case click on record view again
When I click <ion-back-button />
I expect to return to case.page.ts
.
However, what happens is I am redirected straight to search.page.ts
.
It seems that when I navigate from case.page.ts
the history of my clicks isn't building up but reverses because the page I am intending to go to has already been visited.
Question is how do I deal with this situation? Because my typical user definitely wants to return to case in this example.
Edit: I created a quick POC that tricks router into achieving my expected behaviour, but I don't like it, it was just a quick test, basically adding some random hash to the ID of the result, which tricks router into building a full path:
case.page.html
// link to result from case page
[routerLink]="['/record-view/', recordId+'3SRzrMbhcQGpA']"
result.page.html
// remove hash from the id passed from case
this.recordId = paramMap.get('recordId').replace("3SRzrMbhcQGpA", "");