[feat] User notifications backend (#3280)
Co-authored-by: Arc <33088785+arcbtc@users.noreply.github.com> Co-authored-by: dni ⚡ <office@dnilabs.com>
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -230,6 +230,9 @@ window.localisation.en = {
|
||||
notifications_nostr_private_key: 'Nostr Private Key',
|
||||
notifications_nostr_private_key_desc:
|
||||
'Private key (hex or nsec) to sign the messages sent to Nostr',
|
||||
notifications_nostr_identifier: 'Nostr Identifier',
|
||||
notifications_nostr_identifier_desc:
|
||||
'Nip5 identifier to send notifications to',
|
||||
notifications_nostr_identifiers: 'Nostr Identifiers',
|
||||
notifications_nostr_identifiers_desc:
|
||||
'List of identifiers to send notifications to',
|
||||
@@ -646,5 +649,7 @@ window.localisation.en = {
|
||||
'Signing secret for the webhook. Messages will be signed with this secret.',
|
||||
callback_success_url: 'Callback Success URL',
|
||||
callback_success_url_hint:
|
||||
'The user will be redirected to this URL after the payment is successful'
|
||||
'The user will be redirected to this URL after the payment is successful',
|
||||
connected: 'Connected',
|
||||
not_connected: 'Not Connected'
|
||||
}
|
||||
|
||||
@@ -399,32 +399,6 @@ window.AccountPageLogic = {
|
||||
} finally {
|
||||
this.apiAcl.password = ''
|
||||
}
|
||||
},
|
||||
addNostrNotificationIdentifier() {
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
||||
if (!emailRegex.test(this.notifications.nostr.identifier)) {
|
||||
Quasar.Notify.create({
|
||||
type: 'warning',
|
||||
message: 'Invalid email format.'
|
||||
})
|
||||
return
|
||||
}
|
||||
const identifier = this.user.extra.nostr_notification_identifiers.find(
|
||||
i => i === this.notifications.nostr.identifier
|
||||
)
|
||||
if (identifier) {
|
||||
return
|
||||
}
|
||||
this.user.extra.nostr_notification_identifiers.push(
|
||||
this.notifications.nostr.identifier
|
||||
)
|
||||
this.notifications.nostr.identifier = ''
|
||||
},
|
||||
removeNostrNotificationIdentifier(identifier) {
|
||||
this.user.extra.nostr_notification_identifiers =
|
||||
this.user.extra.nostr_notification_identifiers.filter(
|
||||
i => i !== identifier
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user