LCOV - code coverage report
Current view: top level - src/platform/billing/subscription/composables - useSubscribeCtaPresence.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 37.5 % 8 3
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { computed, onMounted, onUnmounted, ref } from 'vue'
       2              : 
       3         2355 : const mountedPrompts = ref(0)
       4              : 
       5              : /**
       6              :  * Registers a mounted Run-slot subscribe prompt for the caller's lifetime.
       7              :  * The billing flag alone is not evidence a prompt is on screen — builder
       8              :  * mode unmounts the actionbar, Linear mode needs outputs, and the wrapper
       9              :  * withholds the prompt for sales-managed and payment-recovery states — so
      10              :  * anything yielding to the prompt must key on real presence.
      11              :  */
      12            0 : export function registerSubscribeToRunPrompt() {
      13            0 :   onMounted(() => {
      14            0 :     mountedPrompts.value += 1
      15              :   })
      16            0 :   onUnmounted(() => {
      17            0 :     mountedPrompts.value = Math.max(0, mountedPrompts.value - 1)
      18              :   })
      19              : }
      20              : 
      21              : /** Whether any Run-slot subscribe prompt is currently on screen. */
      22         2021 : export function useSubscribeToRunPromptPresence() {
      23         2021 :   return computed(() => mountedPrompts.value > 0)
      24              : }
        

Generated by: LCOV version 2.0-1