Skip to content

Commit

Permalink
Fix dual icons issue when using with Refined GitHub (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
homerchen19 authored Aug 22, 2020
1 parent cd289c5 commit 6042d32
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ts/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import '../css/icons.css';
let colorsDisabled = false;
let darkMode = false;

const fonts = [
{ name: 'FontAwesome', path: 'fonts/fontawesome.woff2' },
{ name: 'Mfizz', path: 'fonts/mfixx.woff2' },
{ name: 'Devicons', path: 'fonts/devopicons.woff2' },
{ name: 'file-icons', path: 'fonts/file-icons.woff2' },
{ name: 'octicons', path: 'fonts/octicons.woff2' },
];

const getSelector = (hostname: string) => {
switch (true) {
case /.*github.*/.test(hostname):
Expand All @@ -36,14 +44,6 @@ const getSelector = (hostname: string) => {
};

const loadFonts = () => {
const fonts = [
{ name: 'FontAwesome', path: 'fonts/fontawesome.woff2' },
{ name: 'Mfizz', path: 'fonts/mfixx.woff2' },
{ name: 'Devicons', path: 'fonts/devopicons.woff2' },
{ name: 'file-icons', path: 'fonts/file-icons.woff2' },
{ name: 'octicons', path: 'fonts/octicons.woff2' },
];

fonts.forEach((font) => {
const fontFace = new FontFace(
font.name,
Expand Down Expand Up @@ -138,7 +138,7 @@ const init = async () => {
}

replaceIcon({
iconDom: select('.octicon', element),
iconDom: select('.octicon-file', element),
filenameDom,
});
},
Expand Down

0 comments on commit 6042d32

Please sign in to comment.