LCOV - code coverage report
Current view: top level - src/platform/billing - billingAccountRefresh.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 10.0 % 10 1
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { effectScope } from 'vue'
       2              : 
       3              : import { refreshBilling } from '@/platform/billing/billingRefresh'
       4              : import { useBillingCapabilities } from '@/platform/billing/composables/useBillingCapabilities'
       5              : 
       6         2356 : let latest:
       7              :   | { readonly returned: Event; readonly read: Promise<unknown> }
       8              :   | undefined
       9              : 
      10            0 : async function refreshCapabilities(): Promise<void> {
      11            0 :   const scope = effectScope(true)
      12            0 :   try {
      13            0 :     await scope.run(useBillingCapabilities)?.refresh()
      14              :   } finally {
      15            0 :     scope.stop()
      16              :   }
      17              : }
      18              : 
      19              : /** Re-reads plan, balance and capabilities once for `returned`, the return to this tab, however many listeners saw it. */
      20            0 : export function refreshBillingAccount(returned: Event): Promise<unknown> {
      21            0 :   if (latest?.returned !== returned) {
      22            0 :     latest = {
      23              :       returned,
      24              :       read: Promise.allSettled([
      25              :         refreshBilling('account'),
      26              :         refreshCapabilities()
      27              :       ])
      28              :     }
      29              :   }
      30            0 :   return latest.read
      31              : }
        

Generated by: LCOV version 2.0-1