Skip to content

Commit

Permalink
use href instead of url composition (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
luorlandini authored Jul 28, 2021
1 parent b49bf02 commit fae9c9e
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
} from '@js/utils/GNSearchUtils';
import debounce from 'lodash/debounce';
import CopyToClipboardCmp from 'react-copy-to-clipboard';
import url from 'url';
import { TextEditable, ThumbnailEditable } from '@js/components/ContentsEditable/';

const CopyToClipboard = tooltip(CopyToClipboardCmp);
Expand Down Expand Up @@ -55,9 +54,7 @@ function formatResourceLinkUrl(resourceUrl = '') {
if (resourceUrl.indexOf('http') === 0) {
return resourceUrl;
}
const { path } = url.parse(resourceUrl);
const { protocol, host } = window.location;
return `${protocol}://${host}${path}`;
return window.location.href;
}

function ThumbnailPreview({
Expand Down Expand Up @@ -281,7 +278,6 @@ function DetailsPanel({
}
];


return (
<div
ref={detailsContainerNode}
Expand Down

0 comments on commit fae9c9e

Please sign in to comment.