Skip to content

Commit

Permalink
rename lastRouteName to previousRoute to match attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerbenw committed Mar 11, 2024
1 parent 3520ee5 commit 28ad5a9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ReactNativeNavigationPlugin implements Plugin<ReactNativeConfiguration> {
private endedBy: Reason = 'immediate'
private componentsWaiting = 0
private spanFactory?: SpanFactory<ReactNativeConfiguration>
private lastRouteName?: string
private previousRoute?: string

constructor (Navigation: NavigationDelegate) {
this.Navigation = Navigation
Expand Down Expand Up @@ -93,11 +93,11 @@ class ReactNativeNavigationPlugin implements Plugin<ReactNativeConfiguration> {
this.currentNavigationSpan.setAttribute('bugsnag.navigation.route', routeName)
this.currentNavigationSpan.setAttribute('bugsnag.navigation.triggered_by', '@bugsnag/react-native-navigation-performance')

if (this.lastRouteName) {
this.currentNavigationSpan.setAttribute('bugsnag.navigation.previous_route', this.lastRouteName)
if (this.previousRoute) {
this.currentNavigationSpan.setAttribute('bugsnag.navigation.previous_route', this.previousRoute)
}

this.lastRouteName = routeName
this.previousRoute = routeName

this.endedBy = 'immediate'

Expand Down

0 comments on commit 28ad5a9

Please sign in to comment.