@@ -51,12 +51,6 @@ import Connect from "../components/Connect.astro";
5151 >
5252</div >
5353<script >
54- import { wagmiAdapter } from "../scripts/appkit";
55- import { getMessage } from "../lib/message";
56- import { toXnodeAddress } from "../lib/xnode-address";
57- import { appkitStore } from "../store/appkit";
58- import { signMessage } from "@wagmi/core";
59-
6054 function setRedirect(redirect: string) {
6155 const node = document.getElementById("redirect");
6256 if (node) {
@@ -78,6 +72,15 @@ import Connect from "../components/Connect.astro";
7872 updateDisplay();
7973 }
8074
75+ const urlParams = new URLSearchParams(window.location.search);
76+
77+ const redirect = urlParams.get("redirect") ?? window.location.origin;
78+ setRedirect(redirect);
79+
80+ const rejected = urlParams.get("rejected");
81+ setError(rejected ?? "");
82+
83+ import { appkitStore } from "../store/appkit";
8184 function updateDisplay() {
8285 // Signing indicator
8386 {
@@ -98,21 +101,17 @@ import Connect from "../components/Connect.astro";
98101 }
99102 }
100103
101- const urlParams = new URLSearchParams(window.location.search);
102-
103- const redirect = urlParams.get("redirect") ?? window.location.origin;
104- setRedirect(redirect);
105-
106- const rejected = urlParams.get("rejected");
107- setError(rejected ?? "");
108-
109104 appkitStore.account.subscribe((account) => {
110105 if (!account) {
111106 signingState = false;
112107 }
113108 updateDisplay();
114109 });
115110
111+ import { wagmiAdapter } from "../scripts/wagmi";
112+ import { getMessage } from "../lib/message";
113+ import { toXnodeAddress } from "../lib/xnode-address";
114+ import { signMessage } from "@wagmi/core";
116115 document
117116 .getElementById("authenticate")
118117 ?.addEventListener("click", async () => {
@@ -164,8 +163,6 @@ import Connect from "../components/Connect.astro";
164163 setSigning(false);
165164 }
166165 });
167- </script >
168- <script >
169- import sdk from "@farcaster/miniapp-sdk";
170- sdk.actions.ready();
166+
167+ import "../scripts/miniapp";
171168</script >
0 commit comments