fix(frontend): опечатка в DeleteYes, двойной tap в MenuPage (22.09.2026)

This commit is contained in:
2026-09-22 12:50:44 +03:00
parent 881c8b99d6
commit eabe823d7f
2 changed files with 41 additions and 25 deletions
+1 -3
View File
@@ -940,9 +940,7 @@ const FeedModal: React.FC<FeedModalProps> = ({ isOpen, onClose, section, isAdmin
cursor: isDeleting ? 'default' : 'pointer', cursor: isDeleting ? 'default' : 'pointer',
}} }}
> >
{isDeleting {isDeleting ? '...' : (t('feedAdminDeleteYes') || 'Да, удалить')}
? '...'
: (t('feedAdminDeleteNo') ? (t('feedAdminDeleteYes') || 'Да, удалить') : 'Да, удалить')}
</button> </button>
</div> </div>
</div> </div>
+21 -3
View File
@@ -85,11 +85,19 @@ const MenuPage: React.FC = () => {
return labels[language] || labels.en; return labels[language] || labels.en;
}; };
const makeButtonHandlers = useCallback((buttonName: string, action: () => void) => ({ // 🔧 ФИКС (22.09.2026): на мобильных (TG WebView) тап вызывал action дважды —
// сначала onTouchEnd, потом синтетический onMouseUp. Открывались 2 модалки.
// Решение: убираем action() из onMouseUp — оставляем только визуальный сброс.
// На десктопе (без touch) работает onMouseUp → action.
const makeButtonHandlers = useCallback((buttonName: string, action: () => void) => {
let touchHandled = false;
return {
onTouchStart: (e: React.TouchEvent) => { onTouchStart: (e: React.TouchEvent) => {
touchStartY.current = e.touches[0].clientY; touchStartY.current = e.touches[0].clientY;
touchStartX.current = e.touches[0].clientX; touchStartX.current = e.touches[0].clientX;
touchMoved.current = false; touchMoved.current = false;
touchHandled = false;
setPressing(buttonName); setPressing(buttonName);
}, },
onTouchMove: (e: React.TouchEvent) => { onTouchMove: (e: React.TouchEvent) => {
@@ -103,12 +111,22 @@ const MenuPage: React.FC = () => {
onTouchEnd: () => { onTouchEnd: () => {
setPressing(null); setPressing(null);
if (!touchMoved.current) { if (!touchMoved.current) {
touchHandled = true;
action(); action();
} }
}, },
onMouseDown: () => setPressing(buttonName), onMouseDown: () => setPressing(buttonName),
onMouseUp: () => { setPressing(null); action(); }, onMouseUp: () => {
}), []); setPressing(null);
// 🔧 Если touch уже обработал — не вызываем action повторно
if (touchHandled) {
touchHandled = false;
return;
}
action();
},
};
}, []);
useEffect(() => { useEffect(() => {
const myId = getUserId(); const myId = getUserId();