This commit is contained in:
PMC Holding 2026-03-15 22:51:49 +00:00 committed by GitHub
commit d18355b378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 6 deletions

View File

@ -1,6 +1,7 @@
import { formatCliCommand } from "../../../src/cli/command-format.js";
import type { PollInput } from "../../../src/polls.js";
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
import { resolveGlobalMap } from "../../../src/shared/global-singleton.js";
export type ActiveWebSendOptions = {
gifPlayback?: boolean;
@ -28,9 +29,8 @@ export type ActiveWebListener = {
close?: () => Promise<void>;
};
let _currentListener: ActiveWebListener | null = null;
const listeners = new Map<string, ActiveWebListener>();
const WA_LISTENERS_KEY = Symbol.for("openclaw.whatsappActiveListeners");
const listeners = resolveGlobalMap<string, ActiveWebListener>(WA_LISTENERS_KEY);
export function resolveWebAccountId(accountId?: string | null): string {
return (accountId ?? "").trim() || DEFAULT_ACCOUNT_ID;
@ -73,9 +73,6 @@ export function setActiveWebListener(
} else {
listeners.set(id, listener);
}
if (id === DEFAULT_ACCOUNT_ID) {
_currentListener = listener;
}
}
export function getActiveWebListener(accountId?: string | null): ActiveWebListener | null {