Skip to content

Commit

Permalink
feat: make usable outside telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
thebatclaudio committed Sep 11, 2024
1 parent 2fde120 commit 9f87388
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/common/store/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ export const Telegram: Reactive<Telegram> = reactive<Telegram>({
this.initClient();
},
initTelegramData() {
const launchParams = retrieveLaunchParams();

this.initDataRaw = launchParams.initDataRaw;
this.initData = launchParams.initData;
try {
const launchParams = retrieveLaunchParams();
this.initDataRaw = launchParams.initDataRaw;
this.initData = launchParams.initData;
} catch (e) {
console.log('not in telegram app');
}
},
async initWallet() {
await this.tonConnectUI?.getWallets();
Expand Down
4 changes: 0 additions & 4 deletions src/components/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
import { initHapticFeedback } from '@telegram-apps/sdk';
import { FaceSmileIcon } from '@heroicons/vue/24/solid';
import { HeadsOrTails } from '../../wrappers/HeadsOrTails';
import Modal from '../modals/Modal.vue';
Expand All @@ -9,8 +8,6 @@ import { store } from '../../common/store';
const jettonSymbol = ref(import.meta.env.VITE_JETTON_SYMBOL);
const hapticFeedback = initHapticFeedback();
const amount = ref(1);
const currentBalance = ref(0);
Expand Down Expand Up @@ -56,7 +53,6 @@ const viewTransaction = () => {
}
const incrementAmount = () => {
console.log('increment');
if (amount.value + 0.1 <= (max_bet.value)) {
amount.value = (amount.value + 0.1)
}
Expand Down

0 comments on commit 9f87388

Please sign in to comment.