Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Highlight original source for sources tree (#5511)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing authored and jasonLaster committed Mar 12, 2018
1 parent 9789111 commit abf2574
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/PrimaryPanes/SourcesTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
getExtension
} from "../../utils/sources-tree";

import { getRawSourceURL } from "../../utils/source";
import { copyToTheClipboard } from "../../utils/clipboard";
import { features } from "../../utils/prefs";

Expand Down Expand Up @@ -132,7 +133,7 @@ class SourcesTree extends Component<Props, State> {
nextProps.selectedSource != selectedSource
) {
const highlightItems = getDirectories(
nextProps.selectedSource.get("url"),
getRawSourceURL(nextProps.selectedSource.get("url")),
sourceTree
);

Expand Down
2 changes: 1 addition & 1 deletion src/utils/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function getPrettySourceURL(url: ?string): string {
* @static
*/
export function getRawSourceURL(url: string): string {
return url.replace(/:formatted$/, "");
return url ? url.replace(/:formatted$/, "") : url;
}

function resolveFileURL(
Expand Down

0 comments on commit abf2574

Please sign in to comment.