mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:11:26 +00:00
fix: resolve ChatStreamer import path and TypeScript narrowing issue
- Import ChatStreamer from @slack/web-api/dist/chat-stream.js (not re-exported from index) - Fix TypeScript control flow narrowing for streamSession used in closure
This commit is contained in:
12938
package-lock.json
generated
Normal file
12938
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -284,9 +284,10 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
|
|||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// Finalize the stream if one was started
|
// Finalize the stream if one was started
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
if (streamSession && !streamSession.stopped) {
|
const finalStream = streamSession as SlackStreamSession | null;
|
||||||
|
if (finalStream && !finalStream.stopped) {
|
||||||
try {
|
try {
|
||||||
await stopSlackStream({ session: streamSession });
|
await stopSlackStream({ session: finalStream });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
runtime.error?.(danger(`slack-stream: failed to stop stream: ${String(err)}`));
|
runtime.error?.(danger(`slack-stream: failed to stop stream: ${String(err)}`));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
* @see https://docs.slack.dev/reference/methods/chat.stopStream
|
* @see https://docs.slack.dev/reference/methods/chat.stopStream
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ChatStreamer, WebClient } from "@slack/web-api";
|
import type { WebClient } from "@slack/web-api";
|
||||||
|
import type { ChatStreamer } from "@slack/web-api/dist/chat-stream.js";
|
||||||
import { logVerbose } from "../globals.js";
|
import { logVerbose } from "../globals.js";
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user