Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions demo/src/wallet_frontend/src/lib/GetICP.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<script lang="ts">
import Button from '$core/components/Button.svelte';
import { PROD } from '$core/constants/app.constants';
import { authStore } from '$core/stores/auth.store';
import { emit } from '$core/utils/events.utils';

const onClick = async () => {
await fetch(
`http://localhost:5999/ledger/transfer/?to=${$authStore.identity?.getPrincipal() ?? ''}`
);
// The faucet is a local-only Juno satellite (see demo/docker-compose.yml) used for local
// development and E2E. Guard the call so it never fires from a production build.
if (!PROD) {
await fetch(
`http://localhost:5999/ledger/transfer/?to=${$authStore.identity?.getPrincipal() ?? ''}`
);
}

emit({
message: 'oisyDemoReloadBalance'
Expand Down
Loading