debian-mirror-gitlab/app/assets/javascripts/lib/utils/favicon_ci.js
2021-03-08 18:12:59 +05:30

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;
});