Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
clean up codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgilangjanuar committed May 10, 2022
1 parent f1aac91 commit edd7c3e
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 4 deletions.
Binary file removed web/public/71e90abb-f036-4892-a255-0e3d1bf7e472.webp
Binary file not shown.
Binary file removed web/public/Screen Shot 2021-11-18 at 09.19.11.png
Binary file not shown.
Binary file removed web/public/Tweet by Telegram Messenger.png
Binary file not shown.
Binary file removed web/public/d38bbf8e-636e-4acb-9300-1de90a6be13b.webp
Binary file not shown.
Binary file removed web/public/quickmessage.png
Binary file not shown.
Binary file removed web/public/signature-alt.png
Binary file not shown.
Binary file removed web/public/signature.png
Binary file not shown.
4 changes: 2 additions & 2 deletions web/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Login: React.FC<Props> = ({ me }) => {
localStorage.setItem('session', session)
data = { phoneCodeHash: newPhoneCodeHash, timeout }
} else {
const { phoneCodeHash } = await client.invoke(new Api.auth.SendCode({
const { phoneCodeHash, timeout } = await client.invoke(new Api.auth.SendCode({
apiId: Number(process.env.REACT_APP_TG_API_ID),
apiHash: process.env.REACT_APP_TG_API_HASH,
phoneNumber,
Expand All @@ -75,7 +75,7 @@ const Login: React.FC<Props> = ({ me }) => {
}))
const session = client.session.save() as any
localStorage.setItem('session', session)
data = { phoneCodeHash }
data = { phoneCodeHash, timeout }
}
} else {
const invitationCode = location.search.replace('?code=', '')
Expand Down
4 changes: 2 additions & 2 deletions web/src/utils/Telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const telegramClient = {
}

export const anonymousTelegramClient = {
connect: async (): Promise<TelegramClient> => {
const client = new TelegramClient(new StringSession(localStorage.getItem('session') || ''), Number(process.env.REACT_APP_TG_API_ID), process.env.REACT_APP_TG_API_HASH as string, {
connect: async (session = localStorage.getItem('session') || ''): Promise<TelegramClient> => {
const client = new TelegramClient(new StringSession(session), Number(process.env.REACT_APP_TG_API_ID), process.env.REACT_APP_TG_API_HASH as string, {
connectionRetries: 10,
useWSS: true,
// baseLogger: new Logger(LogLevel.NONE)
Expand Down

0 comments on commit edd7c3e

Please sign in to comment.