Skip to content

Commit

Permalink
Use hasOwnProperty for compatibility with old webkit
Browse files Browse the repository at this point in the history
Issue #99
  • Loading branch information
qu1ck committed Oct 22, 2023
1 parent 6ed991d commit 052785b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/fileicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export function FileIcon({ name, selected }: { name: string, selected: boolean }
const theme = useMantineTheme();

const ext = name.substring(name.lastIndexOf(".") + 1).toLowerCase();
const FileIcon = Object.hasOwn(extensions, ext) ? extensions[ext].icon : Icon.FileEarmark;
const color = Object.hasOwn(extensions, ext) ? extensions[ext].color : "gray";
const FileIcon = Object.prototype.hasOwnProperty.call(extensions, ext) ? extensions[ext].icon : Icon.FileEarmark;
const color = Object.prototype.hasOwnProperty.call(extensions, ext) ? extensions[ext].color : "gray";
const shade = (theme.colorScheme === "dark" || selected) ? 3 : 9;

return <FileIcon size="1.1rem" color={theme.colors[color][shade]} />;
Expand Down

0 comments on commit 052785b

Please sign in to comment.