feat: Add subscriptionDetails getter to RelayHub for detailed subscription information
- Implement a new getter method in RelayHub to return an array of subscription details, including IDs, filters, and associated relays. - Enhance the ability to track and manage subscriptions more effectively within the RelayHub component.
This commit is contained in:
parent
8fb0c40797
commit
48761e8035
4 changed files with 150 additions and 2 deletions
|
|
@ -14,6 +14,9 @@ export function useRelayHub() {
|
|||
const connectedRelayCount = ref(0)
|
||||
const totalRelayCount = ref(0)
|
||||
const totalSubscriptionCount = ref(0)
|
||||
|
||||
// Reactive subscription details
|
||||
const subscriptionDetails = ref<Array<{ id: string; filters: any[]; relays?: string[] }>>([])
|
||||
|
||||
// Computed properties
|
||||
const connectionHealth = computed(() => {
|
||||
|
|
@ -231,6 +234,7 @@ export function useRelayHub() {
|
|||
connectedRelayCount.value = relayHub.connectedRelayCount
|
||||
totalRelayCount.value = relayHub.totalRelayCount
|
||||
totalSubscriptionCount.value = relayHub.totalSubscriptionCount
|
||||
subscriptionDetails.value = relayHub.subscriptionDetails
|
||||
}
|
||||
|
||||
// Update immediately and then every 10 seconds
|
||||
|
|
@ -280,6 +284,7 @@ export function useRelayHub() {
|
|||
connectedRelayCount,
|
||||
totalRelayCount,
|
||||
totalSubscriptionCount,
|
||||
subscriptionDetails,
|
||||
connectionHealth,
|
||||
|
||||
// Methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue