log error if not github or gitlab

Co-authored-by: Otto Sichert <git@ottosichert.de>
Signed-off-by: Anders Näsman <andersn@spotify.com>
This commit is contained in:
Anders Näsman
2022-04-20 13:54:27 +02:00
parent a558ca8308
commit 80bad5cf73
@@ -32,8 +32,14 @@ import { PAGE_EDIT_LINK_SELECTOR } from './constants';
const resolveBlobUrl = (url: string, type: string) => {
if (type === 'github') {
return replaceGitHubUrlType(url, 'blob');
} else if (type === 'gitlab') {
return replaceGitLabUrlType(url, 'blob');
}
return replaceGitLabUrlType(url, 'blob');
// eslint-disable-next-line no-console
console.error(
`Invalid SCM type ${type} found in ReportIssue addon for URL ${url}!`,
);
return url;
};
export const getTitle = (selection: Selection) => {