- 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
35 lines
No EOL
714 B
TypeScript
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,
|
|
}
|
|
})
|