summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/selectors/sources.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/src/selectors/sources.js')
-rw-r--r--devtools/client/debugger/src/selectors/sources.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/devtools/client/debugger/src/selectors/sources.js b/devtools/client/debugger/src/selectors/sources.js
index 938eae9fe2..6a67cf1a32 100644
--- a/devtools/client/debugger/src/selectors/sources.js
+++ b/devtools/client/debugger/src/selectors/sources.js
@@ -163,6 +163,16 @@ export function getSelectedMappedSource(state) {
return mappedSource || null;
}
+/**
+ * Helps knowing if we are still computing the mapped location for the currently selected source.
+ */
+export function isSelectedMappedSourceLoading(state) {
+ const { selectedOriginalLocation } = state.sources;
+ // This `selectedOriginalLocation` attribute is set to UNDEFINED_LOCATION when selecting a new source attribute
+ // and later on, when the source map is processed, it will switch to either a valid location object, or NO_LOCATION if no valid one if found.
+ return selectedOriginalLocation === UNDEFINED_LOCATION;
+}
+
export const getSelectedSource = createSelector(
getSelectedLocation,
selectedLocation => {