Lynx/Modules/OTA Update UI/UpdatePrompt
@sigx/lynx-updates-ui · Beta · Component library

UpdatePrompt#

A modal offering an optional (non-mandatory) update. Appears automatically when an update is available; "Update" downloads it, "Later" suppresses re-prompts for that update id.

Import#

TSX
import { UpdatePrompt } from '@sigx/lynx-updates-ui';

Usage#

Drop <UpdatePrompt> anywhere inside your tree. It shows automatically when the headless state reaches status: 'available' with mandatory: false, unless the user already dismissed this update id. It shows manifest.version and manifest.metadata?.releaseNotes.

TSX
import { UpdatePrompt } from '@sigx/lynx-updates-ui';

// Download now, apply on the next cold launch (default).
<UpdatePrompt applyOn="next-launch" />
  • UpdateUpdates.download(); with applyOn="restart" it then Updates.apply()s immediately (in-place reload). The default 'next-launch' leaves the staged update for the next cold start (pair it with UpdateReadyBanner to offer an immediate restart).
  • Later → dismisses and suppresses re-prompts for that update id (persisted via @sigx/lynx-storage, key __sigx_updates_dismissed:<id>), and fires onDismiss.

Mandatory updates never prompt — UpdateGate owns those.

Props#

PropTypeDefaultDescription
applyOn'restart' | 'next-launch''next-launch'When the downloaded update takes effect after "Update".
titlestring'Update available'Modal headline.
classstringExtra class for the modal box.

Events#

EventPayloadDescription
onDismiss() => voidFired when the user taps "Later" (or the backdrop).

See the dismissal helpers to read or set dismissals yourself.