@@ -98,8 +98,8 @@ export function selectLocation(location: Location) {
9898 return ;
9999 }
100100
101- const source = getSource ( getState ( ) , location . sourceId ) ;
102- if ( ! source ) {
101+ const sourceRecord = getSource ( getState ( ) , location . sourceId ) ;
102+ if ( ! sourceRecord ) {
103103 // If there is no source we deselect the current selected source
104104 return dispatch ( { type : "CLEAR_SELECTED_SOURCE" } ) ;
105105 }
@@ -109,21 +109,23 @@ export function selectLocation(location: Location) {
109109 dispatch ( closeActiveSearch ( ) ) ;
110110 }
111111
112- dispatch ( addTab ( source . toJS ( ) , 0 ) ) ;
112+ const source = sourceRecord . toJS ( ) ;
113113
114+ dispatch ( addTab ( source , 0 ) ) ;
114115 dispatch ( {
115116 type : "SELECT_SOURCE" ,
116- source : source . toJS ( ) ,
117+ source,
117118 location
118119 } ) ;
119120
120- await dispatch ( loadSourceText ( source ) ) ;
121+ await dispatch ( loadSourceText ( sourceRecord ) ) ;
121122 const selectedSource = getSelectedSource ( getState ( ) ) ;
122123 if ( ! selectedSource ) {
123124 return ;
124125 }
125126
126- const sourceId = selectedSource . get ( "id" ) ;
127+ const sourceId = selectedSource . id ;
128+
127129 if (
128130 prefs . autoPrettyPrint &&
129131 ! getPrettySource ( getState ( ) , sourceId ) &&
@@ -151,8 +153,8 @@ export function selectSpecificLocation(location: Location) {
151153 return ;
152154 }
153155
154- const source = getSource ( getState ( ) , location . sourceId ) ;
155- if ( ! source ) {
156+ const sourceRecord = getSource ( getState ( ) , location . sourceId ) ;
157+ if ( ! sourceRecord ) {
156158 // If there is no source we deselect the current selected source
157159 return dispatch ( { type : "CLEAR_SELECTED_SOURCE" } ) ;
158160 }
@@ -162,21 +164,22 @@ export function selectSpecificLocation(location: Location) {
162164 dispatch ( closeActiveSearch ( ) ) ;
163165 }
164166
165- dispatch ( addTab ( source . toJS ( ) , 0 ) ) ;
167+ const source = sourceRecord . toJS ( ) ;
166168
169+ dispatch ( addTab ( source , 0 ) ) ;
167170 dispatch ( {
168171 type : "SELECT_SOURCE" ,
169- source : source . toJS ( ) ,
172+ source,
170173 location
171174 } ) ;
172175
173- await dispatch ( loadSourceText ( source ) ) ;
176+ await dispatch ( loadSourceText ( sourceRecord ) ) ;
174177 const selectedSource = getSelectedSource ( getState ( ) ) ;
175178 if ( ! selectedSource ) {
176179 return ;
177180 }
178181
179- const sourceId = selectedSource . get ( "id" ) ;
182+ const sourceId = selectedSource . id ;
180183 dispatch ( setSymbols ( sourceId ) ) ;
181184 dispatch ( setOutOfScopeLocations ( ) ) ;
182185 } ;
0 commit comments