From 3990c26c47de113968e8f310ad5e0744a4083d5e Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 3 Aug 2023 17:20:41 -0400 Subject: [PATCH 1/2] Bugfix for the fetching progress bar value updating with relay set from the broadcasting --- js/nostr-broadcast.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/nostr-broadcast.js b/js/nostr-broadcast.js index 825b6a2..b50517b 100644 --- a/js/nostr-broadcast.js +++ b/js/nostr-broadcast.js @@ -35,16 +35,17 @@ const fetchAndBroadcast = async () => { // get all events from relays const filters =[{ authors: [pubkey] }, { "#p": [pubkey] }] const data = (await getEvents(filters, pubkey)).sort((a, b) => b.created_at - a.created_at) + + // inform user fetching is done + $('#fetching-status').html(txt.fetching + checkMark) + $('#fetching-progress').val(relays.length) + const latestKind3 = data.filter((it) => it.kind == 3 && it.pubkey === pubkey)[0] const myRelaySet = JSON.parse(latestKind3.content) relays = Object.keys(myRelaySet).filter(url => myRelaySet[url].write).map(url => url) $('#checking-relays-header-box').css('display', 'none') $('#checking-relays-box').css('display', 'none') - - // inform user fetching is done - $('#fetching-status').html(txt.fetching + checkMark) - $('#fetching-progress').val(relays.length) // inform user that backup file (js format) is being downloaded $('#file-download').html(txt.download) downloadFile(data, 'nostr-backup.js') From 04463e1a2cf7b0f387e664b6e18cdda0361e9c2d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 3 Aug 2023 18:57:56 -0400 Subject: [PATCH 2/2] - Waits for the broadcasting to finish. - Adds a way to load the backup file and just broadcast - Displays number of downloads and accepted uploads --- index.html | 32 ++++++++++++++- js/nostr-broadcast.js | 69 +++++++++++++++++++++++++++++++++ js/nostr-utils.js | 90 +++++++++++++++++++++++++++---------------- style.css | 5 +++ 4 files changed, 161 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index 27c39d5..3c46c5b 100644 --- a/index.html +++ b/index.html @@ -50,7 +50,7 @@
-
+

+
+
+ OR +
+
+
+
+

+ +

+ +
+
@@ -82,13 +104,19 @@ color: #999; } - +

+