Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions webapp/src/components/link_tooltip/link_tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ export const getInfoAboutLink = (href, hostname) => {
return {};
};

export const LinkTooltip = ({href, connected, gitlabURL}) => {
export const LinkTooltip = ({href, connected, gitlabURL, show}) => {
const [data, setData] = useState(null);
const dispatch = useDispatch();
useEffect(() => {
if (!connected || !show) {
return;
}

if (!isValidUrl(href)) {
return;
}
Expand Down Expand Up @@ -74,12 +78,8 @@ export const LinkTooltip = ({href, connected, gitlabURL}) => {
}
};

if (!connected) {
return;
}

init();
}, [connected, href]);
}, [connected, href, show]);

const getIconElement = () => {
const iconProps = {
Expand Down Expand Up @@ -118,7 +118,7 @@ export const LinkTooltip = ({href, connected, gitlabURL}) => {
);
};

if (!data) {
if (!data || !show) {
return null;
}

Expand Down Expand Up @@ -210,4 +210,5 @@ LinkTooltip.propTypes = {
href: PropTypes.string.isRequired,
connected: PropTypes.bool.isRequired,
gitlabURL: PropTypes.string.isRequired,
show: PropTypes.bool,
};