Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: set as background for images with uppercase

Ilian Sapundshievf0b999e7d962
diff --git a/app/components/menus/FileMenu.tsx b/app/components/menus/FileMenu.tsx
index 63b0c7c5d..5841887c0 100644
--- a/app/components/menus/FileMenu.tsx
+++ b/app/components/menus/FileMenu.tsx
@@ -267,6 +267,11 @@ function FileMenu(props: Props) {
}
const menuItems = [];
+ const pathLowerCase = selectedFilePath.toLowerCase();
+ const isImageFile = supportedImgs.some(ext =>
+ pathLowerCase.endsWith('.' + ext)
+ );
+
if (selectedEntries.length < 2) {
menuItems.push(
<MenuItem
@@ -390,9 +395,7 @@ function FileMenu(props: Props) {
<ListItemText primary={i18n.t('core:setAsThumbnail')} />
</MenuItem>
);
- if (
- supportedImgs.some(ext => props.selectedFilePath.endsWith('.' + ext))
- ) {
+ if (isImageFile) {
menuItems.push(
<MenuItem
key="setAsBgndTID"