Four states, one shown at a time (offline > reconnecting > just-reconnected > realname-reminder priority): no-network (navigator.onLine + online/offline listeners), reconnecting-with-countdown, just-reconnected, and a skippable realname-verification reminder (bootstrap.security.realname). - connection.ts: claims Tinode's onAutoreconnectIteration(timeoutMs, promise?) callback (single-slot, same pattern as onConnect/onDisconnect) and runs its own 1s-tick countdown off the first call's timeout -- the SDK gives the backoff length once per iteration, it doesn't push a running countdown. Verified the callback's exact three-shape contract (timeoutMs alone starts a countdown; 0+promise means a retry is now in flight; -1 means retrying stopped) by reading the SDK's own Connection class, not guessed. retryReconnectNow() backs "立即重试": clears the countdown and calls tinode.reconnect(true). - "已重新连接,正在同步 N 条新消息" intentionally shown without a fake N -- confirmed via research that the old app never implemented this state at all, and there's no reliable signal here for how many messages arrived while disconnected; inventing a count would be dishonest data. Verified live: toggling browser online/offline events correctly shows and clears the no-network banner. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
See the Oxlint rules documentation for the full list of rules and categories.