Bug 1546202 - Part 3: Remove the isLoading utility function. r=jlast
authorLogan Smyth <loganfsmyth@gmail.com>
Tue, 23 Apr 2019 16:51:24 +0000
changeset 470526 800d67478a31025bf0c61a6d41af87ece51c75cb
parent 470525 d99fa29130d5e1f5a03a13b70ea3460e462d1344
child 470527 ed79e89eea8d82a8a7d4c3e3a673f036d9532f81
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1546202
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546202 - Part 3: Remove the isLoading utility function. r=jlast Depends on D28409 Differential Revision: https://phabricator.services.mozilla.com/D28410
devtools/client/debugger/src/components/Editor/Footer.js
devtools/client/debugger/src/utils/source.js
--- a/devtools/client/debugger/src/components/Editor/Footer.js
+++ b/devtools/client/debugger/src/components/Editor/Footer.js
@@ -14,17 +14,16 @@ import {
   getContext
 } from "../../selectors";
 
 import {
   isPretty,
   isLoaded,
   getFilename,
   isOriginal,
-  isLoading,
   shouldBlackbox
 } from "../../utils/source";
 import { getGeneratedSource } from "../../reducers/sources";
 import { shouldShowPrettyPrint } from "../../utils/editor";
 
 import { PaneToggleButton } from "../shared/Button";
 import AccessibleImage from "../shared/AccessibleImage";
 
@@ -86,17 +85,17 @@ class SourceFooter extends PureComponent
 
   prettyPrintButton() {
     const { cx, selectedSource, togglePrettyPrint } = this.props;
 
     if (!selectedSource) {
       return;
     }
 
-    if (isLoading(selectedSource) && selectedSource.isPrettyPrinted) {
+    if (!isLoaded(selectedSource) && selectedSource.isPrettyPrinted) {
       return (
         <div className="loader" key="pretty-loader">
           <AccessibleImage className="loader" />
         </div>
       );
     }
 
     if (!shouldShowPrettyPrint(selectedSource)) {
--- a/devtools/client/debugger/src/utils/source.js
+++ b/devtools/client/debugger/src/utils/source.js
@@ -393,20 +393,16 @@ export function getMode(
 
   return { name: "text" };
 }
 
 export function isLoaded(source: Source) {
   return source.loadedState === "loaded";
 }
 
-export function isLoading(source: Source) {
-  return source.loadedState === "loading";
-}
-
 export function isInlineScript(source: Source): boolean {
   return source.introductionType === "scriptElement";
 }
 
 export function getTextAtPosition(source: ?Source, location: SourceLocation) {
   if (!source || !source.text) {
     return "";
   }