small refactor of MainButton

This commit is contained in:
InsanusMokrassar committed 2024-07-15 02:45:01 +06:00
1 parent 4343dbbde8
commit 4ce26c707e
1 file changed
+4 -1
@@ -22,6 +22,9 @@ external class MainButton {
fun showProgress(leaveActive: Boolean = definedExternally): MainButton
fun hideProgress(): MainButton
/**
* **This method argument do not accept `this` [WebApp] object**
*/
fun onClick(eventHandler: () -> Unit): MainButton
fun offClick(eventHandler: () -> Unit): MainButton
@@ -36,7 +39,7 @@ data class MainButtonParams(
val isVisible: Boolean? = null
)
@Deprecated(message="Use onClick without EventHandler")
@Deprecated(message = "Use onClick without EventHandler")
fun MainButton.onClick(eventHandler: EventHandler) = onClick {
val that = js("this").unsafeCast<WebApp>()
that.eventHandler()