fix: resolve telegram auth token expiration and clean up codebase

- Fix stale initData comparison in clearStaleSessionIfNeeded that destroyed
  valid refresh tokens on mobile WebView reopens
- Restrict X-Telegram-Init-Data header to auth endpoints only
- Close Mini App on auth retry to force fresh initData from Telegram
- Merge Connection page error/not-configured states for better UX
- Remove unnecessary comments across 40+ files (section dividers,
  restating comments, noise catch block comments)
- Configure ESLint allowEmptyCatch to properly handle intentional
  empty catch blocks (62 warnings resolved)
This commit is contained in:
c0mrade
2026-03-13 17:50:49 +03:00
parent 682b6b70dc
commit 2dab25c5a0
43 changed files with 72 additions and 647 deletions

View File

@@ -62,8 +62,6 @@ export default function InstallationGuide({
const [activePlatformKey, setActivePlatformKey] = useState<string | null>(null);
const [selectedApp, setSelectedApp] = useState<RemnawaveAppClient | null>(null);
// --- Helpers ---
const getLocalizedText = useCallback(
(text: LocalizedText | undefined): string => {
if (!text) return '';
@@ -96,8 +94,6 @@ export default function InstallationGuide({
[appConfig.svgLibrary],
);
// --- Available platforms ---
const availablePlatforms = useMemo(() => {
if (!appConfig.platforms) return [];
const available = platformOrder.filter((key) => {
@@ -110,8 +106,6 @@ export default function InstallationGuide({
return available;
}, [appConfig.platforms, detectedPlatform]);
// --- Auto-select platform & app ---
useEffect(() => {
if (selectedApp || !availablePlatforms.length) return;
const platform = availablePlatforms[0];
@@ -124,8 +118,6 @@ export default function InstallationGuide({
}
}, [appConfig.platforms, availablePlatforms, selectedApp]);
// --- Button renderer (delegates to BlockButtons component) ---
const renderBlockButtons = useCallback(
(buttons: RemnawaveButtonClient[] | undefined, variant: 'light' | 'subtle') => (
<BlockButtons
@@ -153,8 +145,6 @@ export default function InstallationGuide({
],
);
// --- Current platform data ---
const currentPlatformKey = activePlatformKey || availablePlatforms[0];
const currentPlatformData = currentPlatformKey
? (appConfig.platforms[currentPlatformKey] as RemnawavePlatformData | undefined)