• Set manual matching pause state and notify waiters when resuming. Dispatches a custom event for UI synchronization.

    Parameters

    • paused: boolean

      Whether to pause (true) or resume (false) matching.

    Returns void

    export function setManualMatchingPause(paused: boolean): void {
    if (paused) {
    manualPauseActive = true;
    } else if (manualPauseActive) {
    manualPauseActive = false;
    resolvePauseWaiters();
    }

    try {
    globalThis.dispatchEvent?.(
    new CustomEvent("matching:manual-pause", {
    detail: { paused },
    }),
    );
    } catch (error) {
    console.error(
    "[MangaSearchService] Error dispatching manual pause event:",
    error,
    );
    }
    }