Skip to content
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

Photo got deleted after registering a new client #83

Closed
salah3x opened this issue May 18, 2019 · 2 comments
Closed

Photo got deleted after registering a new client #83

salah3x opened this issue May 18, 2019 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@salah3x
Copy link
Owner

salah3x commented May 18, 2019

After uploading a photo through the form, it got deleted when submitting and navigating to the client profile.

@salah3x salah3x added the bug Something isn't working label May 18, 2019
@salah3x salah3x added this to the v0.4.0 milestone May 18, 2019
@salah3x salah3x self-assigned this May 18, 2019
@salah3x salah3x reopened this May 19, 2019
@salah3x
Copy link
Owner Author

salah3x commented May 20, 2019

The form must inform the PhotoUploadComponent to not delete the photo after being destroyed (due to navigating away) by setting the deleteOnClose property to false right before triggering the navigation, but this change doesn't always get picked up by the upload component.

@salah3x
Copy link
Owner Author

salah3x commented May 20, 2019

The solution is to force change detection after setting deleteOnClose to false in the parent component by calling ChangeDetectorRef.detectChanges().
This will let the PhotoUploadComponent pick up the changes before executing ngOnDestroy()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant