Skip to content

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

feat: allow opening tslinks from search text field

Ilian Sapundshievc555e455faf8
diff --git a/app/components/SearchInline.tsx b/app/components/SearchInline.tsx
index e9ce8a0db..3c5295525 100644
--- a/app/components/SearchInline.tsx
+++ b/app/components/SearchInline.tsx
@@ -66,6 +66,7 @@ interface Props {
searchQuery: TS.SearchQuery; // () => any;
openCurrentDirectory: () => void;
setSearchQuery: (searchQuery: TS.SearchQuery) => void;
+ openLink: (linkURL: string) => void;
currentDirectory: string;
indexedEntriesCount: number;
maxSearchResults: number;
@@ -364,6 +365,11 @@ function SearchInline(props: Props) {
const executeSearch = () => {
let query = textQuery.current;
+ if (query.startsWith('ts:?ts')) {
+ props.openLink(query);
+ clearSearch();
+ return;
+ }
const tagsAND = parseTextQuery(textQuery.current, '+');
query = removeTagsFromQuery(tagsAND, query, '+');
const tagsOR = parseTextQuery(textQuery.current, '|');
@@ -549,6 +555,7 @@ function mapDispatchToProps(dispatch) {
searchLocationIndex: LocationIndexActions.searchLocationIndex,
createLocationsIndexes: LocationIndexActions.createLocationsIndexes,
// loadDirectoryContent: AppActions.loadDirectoryContent,
+ openLink: AppActions.openLink,
openURLExternally: AppActions.openURLExternally,
openCurrentDirectory: AppActions.openCurrentDirectory
},