[sources] tweak selectSpecificLocation
I noticed we call two actions unnecessarily.
- closeActiveSearch
- addTab
NOTE: i made up hasTab, i have no idea whether that exists :)
diff --git a/src/actions/sources/select.js b/src/actions/sources/select.js
index 3c673fc..0ac5c17 100644
--- a/src/actions/sources/select.js
+++ b/src/actions/sources/select.js
@@ -162,13 +162,16 @@ export function selectSpecificLocation(location: Location) {
}
const activeSearch = getActiveSearch(getState());
- if (activeSearch !== "file") {
+ if (activeSearch && activeSearch !== "file") {
dispatch(closeActiveSearch());
}
const source = sourceRecord.toJS();
- dispatch(addTab(source, 0));
+ if (!hasTab(getState(), source)) {
+ dispatch(addTab(source, 0));
+ }
+
dispatch(setSelectedLocation(source, location));
await dispatch(loadSourceText(sourceRecord));
```
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
@reescott still interested?
@jasonLaster, Can I take this one?
sure @kenjiO
@jasonLaster I was just browsing through the issues and I think this can be closed now since the pr was merged