Skip to content

Commit 2807c45

Browse files
authored
Manually close transport channel in test app (dfinity#3622)
Manually close transport channel in test app # Changes - Set `autoCloseTransportChannel` option to `false`. - Manually call `signer.closeChannel()` instead. - Split multiple attributes from test app input by new line instead of comma.
1 parent dba38d1 commit 2807c45

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

demos/test-app/src/auth.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export const authWithII = async ({
5757
// Authenticate with signer-js instead if we use the ICRC-25 protocol
5858
if (useIcrc25) {
5959
const transport = new PostMessageTransport({ url: url_ });
60-
const signer = new Signer({ transport, derivationOrigin });
60+
const signer = new Signer({
61+
transport,
62+
derivationOrigin,
63+
autoCloseTransportChannel: false,
64+
});
6165
const attributesRequestId = window.crypto.randomUUID();
6266
const attributesPromise =
6367
requestAttributes !== undefined && requestAttributes.length > 0
@@ -104,6 +108,7 @@ export const authWithII = async ({
104108
delegationPromise,
105109
attributesPromise,
106110
]);
111+
await signer.closeChannel();
107112
return {
108113
identity: DelegationIdentity.fromDelegation(
109114
sessionIdentity,

demos/test-app/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ const init = async () => {
312312
autoSelectionPrincipal,
313313
useIcrc25: useIcrc25El.checked,
314314
requestAttributes: requestAttributesEl.value
315-
.split(",")
315+
.split("\n")
316316
.map((s) => s.trim())
317317
.filter((s) => s.length > 0),
318318
});

0 commit comments

Comments
 (0)