onairos 0.1.338 → 0.1.339

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = GoogleButton;
7
+ var _sdkReact = require("@telegram-apps/sdk-react");
7
8
  var _jsxRuntime = require("react/jsx-runtime");
8
9
  function GoogleButton(_ref) {
9
10
  let {
@@ -12,7 +13,7 @@ function GoogleButton(_ref) {
12
13
  const handleTelegramAuth = () => {
13
14
  try {
14
15
  // Get Telegram Mini App data
15
- const telegramAppUrl = window.Telegram.WebApp.initDataUnsafe;
16
+ const telegramAppUrl = WebApp.initDataUnsafe;
16
17
  const botUsername = 'OnairosMiniApp';
17
18
 
18
19
  // Construct URL to your Othent connect page
@@ -22,15 +23,15 @@ function GoogleButton(_ref) {
22
23
  connectUrl.searchParams.append('startApp', telegramAppUrl?.start_param || '');
23
24
 
24
25
  // Open link using Telegram Mini App API
25
- window.Telegram.WebApp.openLink(connectUrl.toString());
26
+ WebApp.openLink(connectUrl.toString());
26
27
  } catch (error) {
27
28
  console.error('Telegram auth flow failed:', error);
28
29
  }
29
30
  };
30
31
 
31
32
  // Event listener for when the Mini App is closed
32
- window.Telegram.WebApp.onEvent('viewportChanged', () => {
33
- const startParam = window.Telegram.WebApp.initDataUnsafe?.start_param;
33
+ WebApp.onEvent('viewportChanged', () => {
34
+ const startParam = WebApp.initDataUnsafe?.start_param;
34
35
  if (startParam) {
35
36
  try {
36
37
  const authData = JSON.parse(decodeURIComponent(startParam));