mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
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:
@@ -80,8 +80,6 @@ const XCircleIcon = () => (
|
||||
</svg>
|
||||
);
|
||||
|
||||
// ------- Main Component -------
|
||||
|
||||
interface PromoOffersSectionProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,6 @@ export default function SuccessNotificationModal() {
|
||||
return () => document.removeEventListener('keydown', handleKeyDown);
|
||||
}, [isOpen, handleClose]);
|
||||
|
||||
// Haptic feedback on open
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
haptic.notification('success');
|
||||
|
||||
@@ -30,8 +30,6 @@ import {
|
||||
import { Toggle } from './Toggle';
|
||||
import { useNotify } from '../../platform/hooks/useNotify';
|
||||
|
||||
// ============ Icons ============
|
||||
|
||||
const GripIcon = () => (
|
||||
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
|
||||
<path
|
||||
@@ -110,8 +108,6 @@ const ArrowDownIcon = () => (
|
||||
</svg>
|
||||
);
|
||||
|
||||
// ============ Helpers ============
|
||||
|
||||
function generateId(): string {
|
||||
return `custom_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`;
|
||||
}
|
||||
@@ -126,8 +122,6 @@ function configsEqual(a: MenuConfig, b: MenuConfig): boolean {
|
||||
|
||||
const DEFAULT_CONFIG: MenuConfig = { rows: [] };
|
||||
|
||||
// ============ MaxPerRowSelector ============
|
||||
|
||||
interface MaxPerRowSelectorProps {
|
||||
value: number;
|
||||
onChange: (value: number) => void;
|
||||
@@ -153,8 +147,6 @@ function MaxPerRowSelector({ value, onChange }: MaxPerRowSelectorProps) {
|
||||
);
|
||||
}
|
||||
|
||||
// ============ ButtonChip ============
|
||||
|
||||
interface ButtonChipProps {
|
||||
button: MenuButtonConfig;
|
||||
isExpanded: boolean;
|
||||
@@ -358,8 +350,6 @@ function ButtonChip({
|
||||
);
|
||||
}
|
||||
|
||||
// ============ SortableRow ============
|
||||
|
||||
interface SortableRowProps {
|
||||
row: MenuRowConfig;
|
||||
rowIndex: number;
|
||||
@@ -471,8 +461,6 @@ function SortableRow({
|
||||
);
|
||||
}
|
||||
|
||||
// ============ InlineAddPanel ============
|
||||
|
||||
interface InlineAddPanelProps {
|
||||
rowId: string;
|
||||
usedBuiltinIds: Set<string>;
|
||||
@@ -540,8 +528,6 @@ function InlineAddPanel({ rowId, usedBuiltinIds, onAddBuiltin, onAddCustom }: In
|
||||
);
|
||||
}
|
||||
|
||||
// ============ MenuEditorTab ============
|
||||
|
||||
export function MenuEditorTab() {
|
||||
const { t } = useTranslation();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
@@ -66,9 +66,7 @@ if (cachedConfig?.enabled && cachedConfig.type && cachedConfig.type !== 'none')
|
||||
function setCachedConfig(config: AnimationConfig) {
|
||||
try {
|
||||
localStorage.setItem(ANIMATION_CACHE_KEY, JSON.stringify(config));
|
||||
} catch {
|
||||
// localStorage not available
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
export function setCachedAnimationConfig(config: AnimationConfig) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user