Skip to content

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

fix: disabling open in new window for some file types

Ilian Sapundshievfde78f605202
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 0c7ad0a9b..24bdc6f5d 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -604,8 +604,22 @@ function EntryContainer(props: Props) {
locale +
theme +
(openedFile.shouldReload === true ? '&t=' + new Date().getTime() : '');
- if (fileExt.startsWith('mht')) {
+ if (
+ fileExt.startsWith('mht') ||
+ fileExt.startsWith('txt') ||
+ fileExt.startsWith('json')
+ ) {
fileOpenerURL = filePath;
+ } else if (
+ fileExt.startsWith('md')
+ // fileExt.startsWith('txt') ||
+ // fileExt.startsWith('json')
+ ) {
+ props.showNotification(
+ 'Opening this file type in a new window is not supported yet',
+ NotificationTypes.default
+ );
+ return;
}
const fileName = extractFileName(
openedFile.url ? openedFile.url : openedFile.path