Updated welcome message

This commit is contained in:
Simon Cambier
2024-01-20 12:11:09 +01:00
parent 0f7418b22e
commit ec0f8d0a0b

View File

@@ -14,6 +14,7 @@ import {
import { import {
eventBus, eventBus,
EventNames, EventNames,
getTextExtractor,
indexingStep, indexingStep,
IndexingStepType, IndexingStepType,
isCacheEnabled, isCacheEnabled,
@@ -36,8 +37,8 @@ export default class OmnisearchPlugin extends Plugin {
this.addSettingTab(new SettingsTab(this)) this.addSettingTab(new SettingsTab(this))
if (!Platform.isMobile) { if (!Platform.isMobile) {
import('./tools/api-server').then(m => import('./tools/api-server').then(
this.apiHttpServer = m.getServer() m => (this.apiHttpServer = m.getServer())
) )
} }
@@ -119,7 +120,7 @@ export default class OmnisearchPlugin extends Plugin {
}) })
) )
this.executeFirstLaunchTasks() await this.executeFirstLaunchTasks()
await this.populateIndex() await this.populateIndex()
if (this.apiHttpServer && settings.httpApiEnabled) { if (this.apiHttpServer && settings.httpApiEnabled) {
@@ -128,18 +129,17 @@ export default class OmnisearchPlugin extends Plugin {
}) })
} }
executeFirstLaunchTasks(): void { async executeFirstLaunchTasks(): Promise<void> {
const code = '1.10.1' const code = '1.21.0'
if (settings.welcomeMessage !== code) { if (settings.welcomeMessage !== code && getTextExtractor()) {
// const welcome = new DocumentFragment() const welcome = new DocumentFragment()
// welcome.createSpan({}, span => { welcome.createSpan({}, span => {
// span.innerHTML = `🔎 Omnisearch now requires the <strong>Text Extractor</strong> plugin to index PDF and images. See Omnisearch settings for more information.` span.innerHTML = `🔎 Omnisearch can now index .docx and .xlsx documents. Don't forget to update Text Extractor and enable the toggle in Omnisearch settings.`
// }) })
// new Notice(welcome, 20_000) new Notice(welcome, 20_000)
} }
settings.welcomeMessage = code settings.welcomeMessage = code
await this.saveData(settings)
this.saveData(settings)
} }
async onunload(): Promise<void> { async onunload(): Promise<void> {