Return success status from Nostr publish

This commit is contained in:
thePR0M3TH3AN committed 2025-06-30 11:17:55 -04:00
1 parent 20abca7388
commit 00155237a5
5 files changed
+110 -10

No files matched your search

+9 -3
View File
@@ -215,9 +215,15 @@ def handle_post_to_nostr(password_manager: PasswordManager):
encrypted_data = password_manager.get_encrypted_data()
if encrypted_data:
# Post to Nostr
password_manager.nostr_client.publish_json_to_nostr(encrypted_data)
print(colored("Encrypted index posted to Nostr successfully.", "green"))
logging.info("Encrypted index posted to Nostr successfully.")
success = password_manager.nostr_client.publish_json_to_nostr(
encrypted_data
)
if success:
print(colored("\N{WHITE HEAVY CHECK MARK} Sync complete.", "green"))
logging.info("Encrypted index posted to Nostr successfully.")
else:
print(colored("\N{CROSS MARK} Sync failed…", "red"))
logging.error("Failed to post encrypted index to Nostr.")
else:
print(colored("No data available to post.", "yellow"))
logging.warning("No data available to post to Nostr.")