gitlab-org--gitlab-foss/app/assets/javascripts/lib/utils/favicon_ci.js

16 lines
395 B
JavaScript

import axios from './axios_utils';
import { setFaviconOverlay, resetFavicon } from './favicon';
export const setCiStatusFavicon = (pageUrl) =>
axios
.get(pageUrl)
.then(({ data }) => {
if (data && data.favicon) {
return setFaviconOverlay(data.favicon);
}
return resetFavicon();
})
.catch((error) => {
resetFavicon();
throw error;
});