feat: Enhance admin announcement functionality and introduce PWA installation prompt
- Update sendAdminAnnouncement to support multiple configured admin pubkeys and improve console output for clarity. - Add new script send_posts_from_configured_admins.js to send posts from multiple admins for testing purposes. - Implement PWAInstallPrompt component to guide users in installing the app, including handling installation status and browser compatibility. - Integrate PWAInstallPrompt into Home.vue for improved user experience.
This commit is contained in:
parent
8a9ffc5918
commit
0c90af01b1
4 changed files with 399 additions and 7 deletions
|
|
@ -17,10 +17,15 @@ async function sendAdminAnnouncement() {
|
|||
try {
|
||||
console.log('🚀 Sending admin announcement...')
|
||||
|
||||
// Use the configured admin pubkey from your .env file
|
||||
const configuredAdminPubkey = "c116dbc73a8ccd0046a2ecf96c0b0531d3eda650d449798ac5b86ff6e301debe"
|
||||
// Configured admin pubkeys from your .env
|
||||
const configuredAdminPubkeys = [
|
||||
"4b9d7688eba64565dcb77cc8ab157eca1964d5de9f7afabe03eb5b54a43d9882",
|
||||
"30b1ab3683fa6cc0e3695849ee1ec29e9fbae4c9e7ddb7452a4ddb37a0660040",
|
||||
"c116dbc73a8ccd0046a2ecf96c0b0531d3eda650d449798ac5b86ff6e301debe"
|
||||
]
|
||||
|
||||
// For demo purposes, generate a keypair (in real use, you'd have the actual admin nsec)
|
||||
// For demo: generate a keypair, but let's use a specific admin pubkey for testing
|
||||
// In real use, you'd use the actual admin private key
|
||||
const privateKey = generateSecretKey()
|
||||
const publicKey = getPublicKey(privateKey)
|
||||
const nsec = nip19.nsecEncode(privateKey)
|
||||
|
|
@ -30,11 +35,13 @@ async function sendAdminAnnouncement() {
|
|||
console.log(`Public Key (npub): ${npub}`)
|
||||
console.log(`Hex pubkey: ${publicKey}`)
|
||||
console.log('')
|
||||
console.log(`📋 Your configured admin pubkey: ${configuredAdminPubkey}`)
|
||||
console.log(`📋 Your configured admin pubkeys: ${configuredAdminPubkeys.length}`)
|
||||
configuredAdminPubkeys.forEach((pubkey, i) => {
|
||||
console.log(` ${i + 1}. ${pubkey.slice(0, 16)}...`)
|
||||
})
|
||||
console.log('')
|
||||
console.log('💡 To see this as an admin post, either:')
|
||||
console.log(` 1. Update .env: VITE_ADMIN_PUBKEYS='["${publicKey}"]'`)
|
||||
console.log(` 2. Or use the configured admin's actual nsec key`)
|
||||
console.log('💡 To see this as an admin post:')
|
||||
console.log(` Add this pubkey to your .env: "${publicKey}"`)
|
||||
console.log('')
|
||||
|
||||
// Create announcement content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue