Skip to content

Commit dff5505

Browse files
committed
launch network
1 parent e180de8 commit dff5505

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
*/
55

66
/** Whether this is a demo build */
7-
declare const IS_DEMO_BUILD: boolean;
7+
declare const IS_DEMO_BUILD: boolean;

src/lib/demo/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ function attachIframeListeners(): void {
142142
if (!event.data || typeof event.data !== 'object') return;
143143

144144
const message = event.data as WalletPlaygroundMessage;
145-
145+
146146
// Only log messages with expected types
147147
const expectedTypes = ['demo:ready', 'action:open-buy-modal', 'action:open-staking-modal', 'action:open-swap-modal', 'action:close-modal'];
148148
if (message.type && expectedTypes.includes(message.type)) {
149149
console.log('[Demo] Received message:', event.data, 'from:', event.origin);
150150
}
151-
151+
152152
if (!message.type || !message.type.startsWith('action:')) return;
153153

154154
handleParentAction(message.type);

src/main-demo.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { CryptoCurrency } from './lib/Constants';
1818
import { useConfig } from './composables/useConfig';
1919
import { initPwa } from './composables/usePwaInstallPrompt';
2020
import { useInactivityDetection } from './composables/useInactivityDetection';
21+
import { launchNetwork } from './network';
2122

2223
// Side-effects
2324
import './lib/AddressBook';
@@ -103,8 +104,12 @@ async function startDemo() {
103104
render: (h) => h(App),
104105
}).$mount('#app');
105106

106-
// Note: We don't launch network, electrum, or polygon connections in demo mode
107-
// as the demo uses simulated data instead of real blockchain connections
107+
// Launch the Nimiq network connection for demo mode
108+
// This enables network synchronization to start automatically on app load
109+
launchNetwork();
110+
111+
// Note: We don't launch electrum or polygon connections in demo mode
112+
// as BTC and USDC/USDT use simulated data instead of real blockchain connections
108113

109114
// Set active currency to NIM by default for demo
110115
const { state: { activeCurrency } } = useAccountStore();

0 commit comments

Comments
 (0)