Skip to content

Commit 052785b

Browse files
committed
Use hasOwnProperty for compatibility with old webkit
Issue #99
1 parent 6ed991d commit 052785b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/fileicon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export function FileIcon({ name, selected }: { name: string, selected: boolean }
8484
const theme = useMantineTheme();
8585

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

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

0 commit comments

Comments
 (0)