Skip to content

Commit

Permalink
Sync bug fix and update default filter (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaachen authored Dec 22, 2023
1 parent 3e30295 commit 0a6dbfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class OmnivorePlugin extends Plugin {

this.addCommand({
id: "sync",
name: "Sync",
name: "Sync new changes",
callback: () => {
this.fetchOmnivore()
},
Expand Down Expand Up @@ -454,13 +454,14 @@ class OmnivoreSettingTab extends PluginSettingTab {

new Setting(containerEl)
.setName("Filter")
.setDesc("Select an Omnivore search filter type")
.setDesc("Select an Omnivore search filter type. Changing this would reset the 'Last sync' timestamp")
.addDropdown((dropdown) => {
dropdown.addOptions(Filter)
dropdown
.setValue(this.plugin.settings.filter)
.onChange(async (value) => {
this.plugin.settings.filter = value
this.plugin.settings.syncAt = ""
await this.plugin.saveSettings()
})
})
Expand All @@ -475,7 +476,8 @@ class OmnivoreSettingTab extends PluginSettingTab {
text: "https://docs.omnivore.app/using/search",
href: "https://docs.omnivore.app/using/search",
}),
" for more info on search query syntax. Make sure your Filter (in the section above) is set to advanced when using a custom query."
" for more info on search query syntax. Make sure your Filter (in the section above) is set to advanced when using a custom query.",
" Changing this would reset the 'Last Sync' timestamp"
)
})
)
Expand All @@ -487,13 +489,14 @@ class OmnivoreSettingTab extends PluginSettingTab {
.setValue(this.plugin.settings.customQuery)
.onChange(async (value) => {
this.plugin.settings.customQuery = value
this.plugin.settings.syncAt = ""
await this.plugin.saveSettings()
})
)

new Setting(containerEl)
.setName("Last Sync")
.setDesc("Last time the plugin synced with Omnivore")
.setDesc("Last time the plugin synced with Omnivore. The 'Sync' command fetches articles updated after this timestamp")
.addMomentFormat((momentFormat) =>
momentFormat
.setPlaceholder("Last Sync")
Expand Down
2 changes: 1 addition & 1 deletion src/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const DEFAULT_SETTINGS: OmnivoreSettings = {
dateHighlightedFormat: 'yyyy-MM-dd HH:mm:ss',
dateSavedFormat: 'yyyy-MM-dd HH:mm:ss',
apiKey: '',
filter: 'HIGHLIGHTS',
filter: 'ALL',
syncAt: '',
customQuery: '',
template: DEFAULT_TEMPLATE,
Expand Down

0 comments on commit 0a6dbfc

Please sign in to comment.