Skip to content

routes/application: Add routeName tag to all issues #3277

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

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import { action } from '@ember/object';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

import * as Sentry from '@sentry/browser';

export default class ApplicationRoute extends Route {
@service progress;
@service router;
@service session;

beforeModel() {
this.router.on('routeDidChange', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you want to put this in the router itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, I thought extending the router was discouraged these days 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Hhmm, yeah let's leave it like this.

Sentry.configureScope(scope => {
scope.setTag('routeName', this.router.currentRouteName);
});
});

// trigger the task, but don't wait for the result here
//
// we don't need a `catch()` block here because network
Expand Down