[feat] UI for user notifications (#3267)
This commit is contained in:
@@ -80,6 +80,11 @@ window.AccountPageLogic = {
|
||||
token_id_list: [],
|
||||
allRead: false,
|
||||
allWrite: false
|
||||
},
|
||||
notifications: {
|
||||
nostr: {
|
||||
identifier: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -394,8 +399,35 @@ 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
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
try {
|
||||
const {data} = await LNbits.api.getAuthenticatedUser()
|
||||
|
||||
Reference in New Issue
Block a user