refactor(client): use _saveStorage instead of storage.save
This commit is contained in:
parent
0b361d0b8d
commit
bcc5321cee
7 changed files with 15 additions and 4 deletions
|
@ -301,6 +301,15 @@ export class TelegramClient extends BaseTelegramClient {
|
||||||
* Last name of the user (used only for sign-up, defaults to empty)
|
* Last name of the user (used only for sign-up, defaults to empty)
|
||||||
*/
|
*/
|
||||||
lastName?: MaybeDynamic<string>
|
lastName?: MaybeDynamic<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By using this method to sign up an account, you are agreeing to Telegram
|
||||||
|
* ToS. This is required and your account will be banned otherwise.
|
||||||
|
* See https://telegram.org/tos and https://core.telegram.org/api/terms.
|
||||||
|
*
|
||||||
|
* If true, TOS will not be displayed and `tosCallback` will not be called.
|
||||||
|
*/
|
||||||
|
acceptTos?: boolean
|
||||||
}): Promise<User> {
|
}): Promise<User> {
|
||||||
return startTest.apply(this, arguments)
|
return startTest.apply(this, arguments)
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ export async function checkPassword(
|
||||||
userId: res.user.id,
|
userId: res.user.id,
|
||||||
isBot: false,
|
isBot: false,
|
||||||
})
|
})
|
||||||
await this.storage.save?.()
|
await this._saveStorage()
|
||||||
|
|
||||||
return new User(this, res.user)
|
return new User(this, res.user)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ export async function logOut(
|
||||||
|
|
||||||
if (resetSession) {
|
if (resetSession) {
|
||||||
this.storage.reset()
|
this.storage.reset()
|
||||||
await this.storage.save?.()
|
await this._saveStorage()
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -34,6 +34,7 @@ export async function recoverPassword(
|
||||||
userId: res.user.id,
|
userId: res.user.id,
|
||||||
isBot: false,
|
isBot: false,
|
||||||
})
|
})
|
||||||
|
await this._saveStorage()
|
||||||
|
|
||||||
return new User(this, res.user)
|
return new User(this, res.user)
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ export async function signInBot(
|
||||||
userId: res.user.id,
|
userId: res.user.id,
|
||||||
isBot: true,
|
isBot: true,
|
||||||
})
|
})
|
||||||
await this.storage.save?.()
|
await this._saveStorage()
|
||||||
|
|
||||||
return new User(this, res.user)
|
return new User(this, res.user)
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ export async function signIn(
|
||||||
userId: res.user.id,
|
userId: res.user.id,
|
||||||
isBot: false,
|
isBot: false,
|
||||||
})
|
})
|
||||||
await this.storage.save?.()
|
await this._saveStorage()
|
||||||
|
|
||||||
return new User(this, res.user)
|
return new User(this, res.user)
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ export async function signUp(
|
||||||
userId: res.user.id,
|
userId: res.user.id,
|
||||||
isBot: false,
|
isBot: false,
|
||||||
})
|
})
|
||||||
|
await this._saveStorage()
|
||||||
|
|
||||||
return new User(this, res.user)
|
return new User(this, res.user)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue