Skip to content

Commit

Permalink
Update balance
Browse files Browse the repository at this point in the history
  • Loading branch information
chiliec committed Sep 15, 2024
1 parent b0fe396 commit 8444284
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"#root/*": "./build/src/*"
},
"scripts": {
"tunnel": "ngrok http --domain dominant-annually-lobster.ngrok-free.app 80",
"lint": "eslint .",
"format": "eslint . --fix",
"typecheck": "tsc",
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<div v-for="(star, index) in stars" :key="index" class="star" :style="star"></div>
<div class="content-wrapper">
<div class="top-bar">
<div class="coin-balance">{{ balance }} CUBE</div>
<div class="coin-balance">
{{ balance ? bigIntWithCustomSeparator(balance) : "???" }} CUBE
</div>

<div id="ton-connect"></div>
<!-- <div class="wallet-address" @click="toggleMenu">
Expand Down Expand Up @@ -37,6 +39,7 @@ import { useUserStore } from "./stores/userStore";
import { TonConnectUI } from "@tonconnect/ui";
import { enBundle, ruBundle } from "./fluent";
import { useFluent } from "fluent-vue";
import { bigIntWithCustomSeparator } from "../../bot/helpers/numbers";
const fluent = useFluent();
const userStorage = useUserStore();
Expand All @@ -45,10 +48,7 @@ const tonConnectUI = ref<TonConnectUI | null>(null);
provide("tonConnectUI", tonConnectUI);
const userStore = useUserStore();
// const isMenuOpen = ref(false);
// const walletAddress = ref("UQjf...8hGa");
const balance: Ref<number | undefined> = ref(undefined);
const balance: Ref<bigint | undefined> = ref(undefined);
const stars: Ref<
Array<{ top: string; left: string; animationDuration: string; animationDelay: string }>
Expand Down Expand Up @@ -113,7 +113,7 @@ onMounted(async () => {
fluent.bundles.value = [lang === "ru" ? ruBundle : enBundle];
if (user.value) {
userStore.setUser(user.value);
balance.value = user.value.balance;
balance.value = BigInt(user.value.balance);
console.log(user.value);
}
} else {
Expand Down

0 comments on commit 8444284

Please sign in to comment.