fix(features): доска уходит из сайдбара при отключении + тумблер «Теория»
1) Доска при feature_board_enabled=0 не пропадала у учителя/админа: showBoardIfAllowed() зовётся напрямую на ~20 страницах и показывала доску БЕЗ проверки флага, перекрывая hideDisabledFeatures(). Теперь функция сперва грузит features и при board===false держит ссылку скрытой (для всех ролей). 2) Добавлен фич-флаг theory: ключ в вайтлист updateFeatures (backend), тумблер «Теория» в admin → games (GAME_FEATURES), и /theory,/theory.html в map hideDisabledFeatures (скрытие из сайдбара + редирект с /theory при выключении). По умолчанию ВКЛ (opt-in disable). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -525,7 +525,7 @@ function getFeatures(_req, res) {
|
||||
function updateFeatures(req, res) {
|
||||
const allowed = ['crossword', 'hangman', 'pet', 'red_book', 'collection',
|
||||
'flashcards', 'knowledge_map', 'board', 'biochem', 'live_quiz', 'classroom',
|
||||
'gamification', 'assistant', 'sim_builder', 'quantik'];
|
||||
'gamification', 'assistant', 'sim_builder', 'quantik', 'theory'];
|
||||
const updates = req.body;
|
||||
const stmt = db.prepare("INSERT OR REPLACE INTO app_settings (key, value) VALUES (?, ?)");
|
||||
const getOld = db.prepare("SELECT value FROM app_settings WHERE key = ?");
|
||||
|
||||
Reference in New Issue
Block a user