Add pubsub event system and integrate sync notifications

This commit is contained in:
thePR0M3TH3AN
2025-07-18 17:02:05 -04:00
parent 20dfc35f7e
commit 724c0b883f
4 changed files with 69 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ import json
from pydantic import BaseModel
from .manager import PasswordManager
from .pubsub import bus
class VaultExportRequest(BaseModel):
@@ -202,7 +203,9 @@ class SyncService:
"""Publish the vault to Nostr and return event info."""
with self._lock:
bus.publish("sync_started")
result = self._manager.sync_vault()
bus.publish("sync_finished", result)
if not result:
return None
return SyncResponse(**result)