diff --git a/demos/test-app/src/index.ts b/demos/test-app/src/index.ts index a533648c82..04cfa392b9 100644 --- a/demos/test-app/src/index.ts +++ b/demos/test-app/src/index.ts @@ -40,7 +40,9 @@ const customMessageBtn = document.getElementById( ) as HTMLButtonElement; const messagesEl = document.getElementById("messages") as HTMLElement; const hostUrlEl = document.getElementById("hostUrl") as HTMLInputElement; -const whoAmIResponseEl = document.getElementById("whoamiResponse"); +const whoAmIResponseEl = document.getElementById( + "whoamiResponse" +) as HTMLDivElement; const alternativeOriginsEl = document.getElementById( "alternativeOrigins" ) as HTMLDivElement; @@ -300,7 +302,7 @@ const init = async () => { init(); -whoamiBtn!.addEventListener("click", async () => { +whoamiBtn.addEventListener("click", async () => { const identity = await authClient.getIdentity(); const canisterId = Principal.fromText(readCanisterId()); const actor = Actor.createActor(idlFactory, { @@ -311,13 +313,13 @@ whoamiBtn!.addEventListener("click", async () => { canisterId, }); - whoAmIResponseEl!.innerText = "Loading..."; + whoAmIResponseEl.innerText = "Loading..."; // Similar to the sample project on dfx new: actor .whoami() .then((principal: any) => { - whoAmIResponseEl!.innerText = principal.toText(); + whoAmIResponseEl.innerText = principal.toText(); }) .catch((err) => { console.error("Failed to fetch whoami", err);