diff --git a/src/main.ts b/src/main.ts index fe58ba5..f25c893 100644 --- a/src/main.ts +++ b/src/main.ts @@ -160,8 +160,11 @@ export default class WikidataSidebarPlugin extends Plugin { async searchWikidataMetadataByProperty(propertyname: string, propertyvalue: string): Promise { const searchResults = await this.serviceProvider.getByProperty(propertyname, propertyvalue); console.log(`Found ${searchResults.length}`); - console.log('hello'); - return await this.openWikidataSuggestModal(searchResults); + if (searchResults.length == 1) { + return searchResults[0]; + } else { + return await this.openWikidataSuggestModal(searchResults); + } } async openWikidataSuggestModal(items: WikidataEntity[]): Promise {