diff --git a/extensions/search/src/EngineSearchApp.ts b/extensions/search/src/EngineSearchApp.ts index 9c7c7ae..f78affc 100644 --- a/extensions/search/src/EngineSearchApp.ts +++ b/extensions/search/src/EngineSearchApp.ts @@ -1,4 +1,4 @@ -import { ExtensionModule, InfoItem, ScriptItem } from '@rokii/api'; +import { App, ExtensionModule, InfoItem, ScriptItem } from '@rokii/api'; import { google, duckduckgo, @@ -17,9 +17,7 @@ const handlers: Record = { StartPage: startpage }; -export const EngineSearchAppName = 'EngineSearch'; - -export const EngineSearchApp: ExtensionModule['run'] = async (ctx) => { +const EngineSearchRun: ExtensionModule['run'] = async (ctx) => { const { term, display, hide, actions, settings } = ctx; const engine = settings['Search Engine'] as Engine; @@ -47,3 +45,8 @@ export const EngineSearchApp: ExtensionModule['run'] = async (ctx) => { display(items); }; + +export const EngineSearchApp: App = { + id: 'EngineSearch', + run: EngineSearchRun +}; diff --git a/extensions/search/src/index.ts b/extensions/search/src/index.ts index d6fd002..d5e09b7 100644 --- a/extensions/search/src/index.ts +++ b/extensions/search/src/index.ts @@ -2,7 +2,7 @@ import { AppItem, ExtensionModule, ScriptItem } from '@rokii/api'; import { Engine } from './types'; import icons from './icons'; import settings from './settings'; -import { EngineSearchApp, EngineSearchAppName } from './EngineSearchApp'; +import { EngineSearchApp } from './EngineSearchApp'; const run: ExtensionModule['run'] = async ({ term, actions, settings, display }) => { if (!navigator.onLine) return; @@ -21,7 +21,7 @@ const run: ExtensionModule['run'] = async ({ term, actions, settings, display }) const engineIcon = icons[engine]; const engineLauncherItem = new AppItem({ - appName: EngineSearchAppName, + appName: EngineSearchApp.id, title: `Search ${term} with ${engine}`, keepTerm: true, icon: engineIcon @@ -33,9 +33,7 @@ const run: ExtensionModule['run'] = async ({ term, actions, settings, display }) const SerachExtension: ExtensionModule = { name: 'Search', run, - apps: { - [EngineSearchAppName]: EngineSearchApp - }, + apps: [EngineSearchApp], icon: icons.Google, settings };