mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 23:29:33 +00:00
Merge pull request #875 from SuLG-ik/main-button-off-click-issue
Make MainButton.onClick(() -> Unit) and MainButton.offClick(() -> Unit) public
This commit is contained in:
@@ -22,8 +22,8 @@ external class MainButton {
|
||||
fun showProgress(leaveActive: Boolean = definedExternally): MainButton
|
||||
fun hideProgress(): MainButton
|
||||
|
||||
internal fun onClick(eventHandler: () -> Unit): MainButton
|
||||
internal fun offClick(eventHandler: () -> Unit): MainButton
|
||||
fun onClick(eventHandler: () -> Unit): MainButton
|
||||
fun offClick(eventHandler: () -> Unit): MainButton
|
||||
|
||||
internal fun setParams(params: Json): MainButton
|
||||
}
|
||||
@@ -36,6 +36,7 @@ data class MainButtonParams(
|
||||
val isVisible: Boolean? = null
|
||||
)
|
||||
|
||||
@Deprecated(message="Use onClick without EventHandler")
|
||||
fun MainButton.onClick(eventHandler: EventHandler) = onClick {
|
||||
val that = js("this").unsafeCast<WebApp>()
|
||||
that.eventHandler()
|
||||
|
Reference in New Issue
Block a user