mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Skip sync with Readwise if no highlights
This commit is contained in:
parent
5b1fcf6a29
commit
1c31e5fc15
1 changed files with 8 additions and 6 deletions
|
|
@ -88,14 +88,16 @@ export const syncWithIntegration = async (
|
|||
integration: Integration,
|
||||
pages: Page[]
|
||||
): Promise<boolean> => {
|
||||
let result = false
|
||||
let result = true
|
||||
switch (integration.type) {
|
||||
case IntegrationType.Readwise:
|
||||
result = await syncWithReadwise(
|
||||
integration.token,
|
||||
pages.flatMap(pageToReadwiseHighlight)
|
||||
)
|
||||
case IntegrationType.Readwise: {
|
||||
const highlights = pages.flatMap(pageToReadwiseHighlight)
|
||||
// If there are no highlights, we will skip the sync
|
||||
if (highlights.length > 0) {
|
||||
result = await syncWithReadwise(integration.token, highlights)
|
||||
}
|
||||
break
|
||||
}
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue