diff --git a/apps/docs/packages/telegram-apps-sdk/2-x/components/mini-app.md b/apps/docs/packages/telegram-apps-sdk/2-x/components/mini-app.md index e34aa7769..4bb3bf13e 100644 --- a/apps/docs/packages/telegram-apps-sdk/2-x/components/mini-app.md +++ b/apps/docs/packages/telegram-apps-sdk/2-x/components/mini-app.md @@ -159,7 +159,7 @@ if (miniApp.setBackgroundColor.isAvailable()) { ``` ```ts [Functions] -import { +import { setMiniAppBackgroundColor, miniAppBackgroundColor, } from '@telegram-apps/sdk'; @@ -172,6 +172,27 @@ if (setMiniAppBackgroundColor.isAvailable()) { ::: +## Active State + +The mini application becomes inactive if it is wrapped into the bottom native Telegram client tray +or if the currently active tab of the mini apps browser is changed to another one. + +To track if the mini application is currently active, use the `isActive` signal. + +::: code-group + +```ts [Variable] +miniApp.isActive(); +``` + +```ts [Functions] +import { isMiniAppActive } from '@telegram-apps/sdk'; + +isMiniAppActive() +``` + +::: + ## Methods ### `close` diff --git a/apps/docs/packages/telegram-apps-sdk/2-x/components/viewport.md b/apps/docs/packages/telegram-apps-sdk/2-x/components/viewport.md index 522cfc23e..d72a71013 100644 --- a/apps/docs/packages/telegram-apps-sdk/2-x/components/viewport.md +++ b/apps/docs/packages/telegram-apps-sdk/2-x/components/viewport.md @@ -110,25 +110,6 @@ if (bindViewportCssVars.isAvailable()) { ::: -## Visibility - -To track if mini app is visible, use `isVisible` signal. -Invisible means app is collapsed or in another tab. - -::: code-group - -```ts [Variable] -viewport.isVisible(); -``` - -```ts [Functions] -import { isVisible } from '@telegram-apps/sdk'; - -isVisible() -``` - -::: - ## Expanding To expand the viewport, use the `expand` method.