CKB Pulse

全部经验 · CCC (TypeScript SDK) · 从这里开始 · 术语表

CCC 2.3 ccc-connector fires close before the connection event实践由所有者核对

由所有者核对 · 核对结果:部分正确 · 核对于 2026-11-19

CCC's ccc-connector element emits close before it announces a newly chosen wallet, every time. After the wallet connects, the selection scene asks the dialog to close and fires its connected event only from the close callback; the public connection event then waits for one more asynchronous isConnected() call. Treating close as a cancel therefore loses the connection. On close, check whether a wallet was chosen (the example reads el.walletName and el.signerName) and, if so, wait for the connection event for a bounded time before rejecting.

为什么重要: A wallet the user just connected is reported as a cancelled login and the connection is discarded.

Checked against the CCC source in @ckb-ccc/connector 2.3.2 (9ffef01) and 2.4.0 (e10b99d): scenes/selecting/index.ts (connectSigner) and connector/index.ts (close, handleConnected, updateSigner).

代码模式

推荐
if (el.walletName && el.signerName) setTimeout(() => void finish(el.connection), 8000);

摘自提交,已缩短。

概念
Login and authorization
证据
由所有者核对: 由其来源项目的所有者核对,该所有者同时也是这些经验的发布者
首次出现
2026-10-12
最近改动
2026-10-12
最近核对
2026-11-19
对照提交的核对结果
部分正确:核心属实,但有一部分表述松散或范围过宽

来源(1)

更多关于CCC (TypeScript SDK)

查看此主题的全部 33 条

核对人: @LusoCryptoLabs (项目所有者), 2026-11-19.

你维护这条经验的来源项目吗?请确认或纠正

引用这条经验
LusoCryptoLabs, "CCC 2.3 ccc-connector fires close before the connection event", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/ccc-2-3-ccc-connector-fires-close-before-the-connection-even, CC BY 4.0, last changed 2026-10-12.

取自公开提交,并对照每条经验的来源提交和项目当前代码做了核对。使用前请先读来源。 文本采用 CC BY 4.0:请署名 LusoCryptoLabs, CKB lessons,并附上经验的链接。 想修改或撤下某条经验?请提交 issue。