-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature 386: Löschen von Asset führt zu Endlosschlaufe #406
base: develop
Are you sure you want to change the base?
Feature 386: Löschen von Asset führt zu Endlosschlaufe #406
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two bugs are indeed resolved, but the browser navigation is now broken
currentAsset: state.currentAsset?.assetId === assetId ? undefined : state.currentAsset, | ||
results: { | ||
...state.results, | ||
data: state.results.data.filter((it) => it.assetId !== assetId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really necessary? We are still performing a search, so the asset will not be there anyways.
Alternatively, you could stop the request from happening, but this seem s overly compoicatead for little gain
ofType(actions.handleSuccessfulDeletion), | ||
switchMap(async ({ assetId }) => { | ||
await this.routingService.navigateBack(['/']); | ||
await this._router.navigate([], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a little weird to navigate twice just to get rid of the asset Id in th url. And it also messes with the history (Once I delete an assset and try to navigate backwards with the mouse buttons, i am stuck - when using the browser buttons though it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do the navigation after removing the asset from the state?
if (this.isUpdatingUrl || !(event instanceof NavigationEnd)) { | ||
return; | ||
} | ||
this.params = await firstValueFrom(this.paramsFromStore$); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks back navigation;
You are reading from the store and writign the same thing back (except for favorites), but when navigatin back, you need to use the url params to write to the store (And not the store params themselves)
Resolves #386 and #370.