Skip to content

Commit

Permalink
Fix collection init logic
Browse files Browse the repository at this point in the history
  • Loading branch information
9dogs committed Nov 6, 2021
1 parent bd77d91 commit 564b1df
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions notion_sync_addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,13 @@ def _reset_stats(self) -> None:

def _sync(self) -> None:
"""Start sync."""
if not self.collection or not self.notes_manager:
self.logger.warning('Collection is not initialized yet')
return
# If collection is not seeded - seed it
if not self._collection_seeded:
self.logger.warning(
'Collection is not seeded yet, trying to seed now'
)
self.seed_collection()
if not self._collection_seeded:
return
self.notion_menu.setTitle('Notion (syncing...)')
for page_spec in self.config.get('notion_pages', []):
page_id, recursive = page_spec['page_id'], page_spec['recursive']
Expand Down

0 comments on commit 564b1df

Please sign in to comment.