Skip to content

Commit 525c091

Browse files
committed
fix(web-client): add missing setSignCb method to WebClient class
1 parent 7ddd2eb commit 525c091

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

crates/web-client/js/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,20 @@ class WebClient {
492492
return result;
493493
}
494494

495+
/**
496+
* Replaces the sign callback on a live WebClient instance.
497+
*
498+
* The message handler reads `this.signCb` fresh on every callback
499+
* invocation, so swapping it here takes effect for all subsequent
500+
* signing requests without recreating the client or the worker.
501+
*
502+
* @param {SignCallback | null | undefined} signCb - The new sign callback,
503+
* or null/undefined to clear it.
504+
*/
505+
setSignCb(signCb) {
506+
this.signCb = signCb ?? null;
507+
}
508+
495509
// TODO: This will soon conflict with some changes in main.
496510
// More context here:
497511
// https://github.com/0xMiden/miden-client/pull/1645?notification_referrer_id=NT_kwHOA1yg7NoAJVJlcG9zaXRvcnk7NjU5MzQzNzAyO0lzc3VlOzM3OTY4OTU1Nzk&notifications_query=is%3Aunread#discussion_r2696075480

0 commit comments

Comments
 (0)