Skip to content

Commit

Permalink
update browser env
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyytop committed Nov 24, 2023
1 parent 36697c4 commit e11cacc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import {useQuery} from "react-query";
import {useWebApp} from "@vkruglikov/react-telegram-web-app"
import {WebApp} from "@vkruglikov/react-telegram-web-app/lib/core/twa-types";
import "./App.css";
import { IS_IPHONE, buildConnectTokenAndUrl, buildSendTxTokenAndUrl, buildSignMsgTokenAndUrl } from "./helper";
import { buildConnectTokenAndUrl, buildSendTxTokenAndUrl, buildSignMsgTokenAndUrl } from "./helper";
import {api, ConnectResp, QueryKey, SendResp, SignResp} from "./api";
import { IS_IPHONE } from "./env/browser";

const USER_REJECTED = 'rejected'

Expand Down
2 changes: 2 additions & 0 deletions src/env/browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const IS_ANDROID = /(Android)/i.test(navigator.userAgent);
export const IS_IPHONE = /(iPhone)/i.test(navigator.userAgent);
2 changes: 1 addition & 1 deletion src/env/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const CALLBACK_SERVER_URL = import.meta.env.VITE_APP_CALLBACK_SERVER_URL ?? "https://lucky-pocket-api.joyid.dev/api/v1";
export const JOYID_APP_URL = import.meta.env.VITE_APP_JOYID_APP_URL ?? "https://joyid-app-git-mini-app-nervina.vercel.app/";
export const JOYID_APP_URL = import.meta.env.VITE_APP_JOYID_APP_URL ?? "https://joyid-app-git-mini-app-nervina.vercel.app/";
3 changes: 0 additions & 3 deletions src/helper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,3 @@ export const buildSendTxTokenAndUrl = (initData: string, address: Hex, tx: Trans
return {token, url};
};

export const IS_ANDROID = /(Android)/i.test(navigator.userAgent);

export const IS_IPHONE = /(iPhone)/i.test(navigator.userAgent);

0 comments on commit e11cacc

Please sign in to comment.