Skip to content

fix(angular): call showReportDialog in root context#11703

Merged
Lms24 merged 1 commit intogetsentry:developfrom
arturovt:fix/angular-show-report
Apr 25, 2024
Merged

fix(angular): call showReportDialog in root context#11703
Lms24 merged 1 commit intogetsentry:developfrom
arturovt:fix/angular-show-report

Conversation

@arturovt
Copy link
Copy Markdown
Contributor

@arturovt arturovt commented Apr 19, 2024

This commit calls showReportDialog outside of the Angular context to prevent
unnecessary view updates when asynchronous tasks are set up within the showReportDialog function.

@arturovt arturovt force-pushed the fix/angular-show-report branch from e3c1594 to 34a62e3 Compare April 20, 2024 11:00
@mydea mydea requested a review from Lms24 April 22, 2024 07:52
},
extends: ['../../.eslintrc.js'],
rules: {
'@sentry-internal/sdk/no-optional-chaining': 'off',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it.

Copy link
Copy Markdown
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for opening this PR! In addition to Abhi's comment, I had another question. But thanks for improving the documentation around this file - this already makes it a lot clearer!

// available in the `<root>` context.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;
const isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.root?.run;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!Zone.root?.run is this function also available in older Angular versions? We need to stay compatible with Angular 14+

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does.

@arturovt arturovt force-pushed the fix/angular-show-report branch from 34a62e3 to ac3ab8b Compare April 22, 2024 16:15
This commit calls `showReportDialog` outside of the Angular context to prevent
unnecessary view updates when asynchronous tasks are set up within the `showReportDialog` function.
@arturovt arturovt force-pushed the fix/angular-show-report branch from ac3ab8b to b05462a Compare April 22, 2024 18:55
Copy link
Copy Markdown
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Lms24 Lms24 merged commit aecbfaf into getsentry:develop Apr 25, 2024
@arturovt arturovt deleted the fix/angular-show-report branch April 25, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants