#57: Fix for mobile

This commit is contained in:
Simon Cambier
2022-05-25 13:31:30 +02:00
parent 124e88e6bf
commit 8eae4a84f9
2 changed files with 32 additions and 13 deletions

View File

@@ -53,16 +53,24 @@ export class SettingsTab extends PluginSettingTab {
}),
)
// Index in real-time
new Setting(containerEl)
.setName('Reindex in real-time')
.setDesc('By default, notes a reindexed when Obsidian focus is lost. Enable this to reindex in real-time. May affect performances.')
.addToggle(toggle =>
toggle.setValue(settings.reindexInRealTime).onChange(async v => {
settings.reindexInRealTime = v
await saveSettings(this.plugin)
}),
)
// Index in real-time, desktop only
if (require('electron')) {
new Setting(containerEl)
.setName('Reindex in real-time')
.setDesc(
'By default, notes a reindexed when Obsidian focus is lost. Enable this to reindex in real-time. May affect performances.',
)
.addToggle(toggle =>
toggle.setValue(settings.reindexInRealTime).onChange(async v => {
settings.reindexInRealTime = v
await saveSettings(this.plugin)
}),
)
}
else {
// No real time indexing on mobile
settings.reindexInRealTime = false
}
new Setting(containerEl).setName('Results weighting').setHeading()