diff --git a/static/js/index.js b/static/js/index.js
index 022399c..8ec41a6 100644
--- a/static/js/index.js
+++ b/static/js/index.js
@@ -9,6 +9,7 @@ window.PageEvents = {
pendingEvents: [],
allUserEvents: [],
isAdmin: false,
+ republishing: false,
settings: {
auto_approve: false
},
@@ -275,6 +276,33 @@ window.PageEvents = {
.catch(LNbits.utils.notifyApiError)
})
},
+ republishAllEvents() {
+ LNbits.utils
+ .confirmDialog(
+ 'Re-emit every approved event to Nostr relays? This is safe ' +
+ 'to run multiple times but generates one event per approved row.'
+ )
+ .onOk(() => {
+ this.republishing = true
+ LNbits.api
+ .request('POST', '/events/api/v1/events/republish-all')
+ .then(response => {
+ Quasar.Notify.create({
+ type: 'positive',
+ message:
+ 'Republished ' +
+ response.data.republished +
+ ' of ' +
+ response.data.total +
+ ' events'
+ })
+ })
+ .catch(LNbits.utils.notifyApiError)
+ .finally(() => {
+ this.republishing = false
+ })
+ })
+ },
foldDateTime(day, time) {
// Combine separate date/time inputs into the wire format
// expected by the events extension: "YYYY-MM-DD" or
diff --git a/static/js/index.vue b/static/js/index.vue
index 4117f47..befc230 100644
--- a/static/js/index.vue
+++ b/static/js/index.vue
@@ -15,6 +15,28 @@
>
+