web-app/src/stores/nostr.ts
padreug a74148a0da chore: Set up Electron configuration and update dependencies
- Add Electron Forge configuration in forge.config.js for packaging and building the app
- Create main Electron entry point in main.cjs for application initialization
- Update package.json scripts for Electron development and building
- Add necessary Electron dependencies to package.json
- Modify .gitignore to exclude build artifacts and temporary files
- Refactor Footer and Navbar components to remove unused imports
- Enhance NostrFeed component by removing unnecessary connection logic
- Update i18n setup for better type safety and locale management
- Refactor Home component to clean up unused code
- Extend Nostr store to manage account state with TypeScript interfaces
2025-03-20 17:26:15 +01:00

35 lines
No EOL
714 B
TypeScript

import { defineStore } from 'pinia'
import { ref } from 'vue'
// Define an interface for the account object
interface NostrAccount {
privkey: string
pubkey: string
}
export const useNostrStore = defineStore('nostr', () => {
const isConnected = ref(false)
const relayUrls = ref<string[]>([])
const account = ref<NostrAccount | null>(null)
function setConnected(value: boolean) {
isConnected.value = value
}
function setRelayUrls(urls: string[]) {
relayUrls.value = urls
}
function setAccount(nostrAccount: NostrAccount | null) {
account.value = nostrAccount
}
return {
isConnected,
relayUrls,
account,
setConnected,
setRelayUrls,
setAccount,
}
})