Skip to content

Commit

Permalink
fix: update sync_at once sync is completed
Browse files Browse the repository at this point in the history
  • Loading branch information
sywhb committed Apr 24, 2024
1 parent 5d09b9f commit 9b7e289
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Item } from '@omnivore-app/api'
import { DateTime } from 'luxon'
import {
addIcon,
normalizePath,
Expand All @@ -17,7 +18,9 @@ import {
renderFilename,
renderItemContent,
} from './settings/template'
import { OmnivoreSettingTab } from './settingsTab'
import {
DATE_FORMAT,
findFrontMatterIndex,
getQueryFromFilter,
parseDateTime,
Expand All @@ -27,7 +30,6 @@ import {
replaceIllegalCharsFolder,
setOrUpdateHighlightColors,
} from './util'
import { OmnivoreSettingTab } from './settingsTab'

export default class OmnivorePlugin extends Plugin {
settings: OmnivoreSettings
Expand Down Expand Up @@ -396,6 +398,10 @@ export default class OmnivorePlugin extends Plugin {
}
}

manualSync && new Notice('🎉 Sync completed')

this.settings.syncAt = DateTime.local().toFormat(DATE_FORMAT)

if (!hasNextPage) {
break
}
Expand All @@ -406,7 +412,6 @@ export default class OmnivorePlugin extends Plugin {
} finally {
this.settings.syncing = false
await this.saveSettings()
manualSync && new Notice('🎉 Sync completed')
}
}

Expand Down

0 comments on commit 9b7e289

Please sign in to comment.