feat: avatar moderation — ученик загружает фото, учитель/админ подтверждает или отклоняет

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-04-14 20:55:45 +03:00
parent 6429e07606
commit c2eb319162
8 changed files with 422 additions and 22 deletions
+20 -16
View File
@@ -649,23 +649,27 @@ const _prefsCache = {};
let _prefsDirty = false;
let _prefsTimer = null;
async function _prefsLoad() {
if (!isLoggedIn()) return;
try {
const data = await apiFetch('/api/preferences', { method: 'GET' });
Object.assign(_prefsCache, data);
} catch (e) {}
}
// SYNC DISABLED (debug mode) — раскомментировать для включения синхронизации
async function _prefsLoad() { /* disabled */ }
function _prefsFlush() { /* disabled */ }
function _prefsFlush() {
if (!_prefsDirty) return;
_prefsDirty = false;
if (!isLoggedIn()) return;
apiFetch('/api/preferences', {
method: 'PATCH',
body: JSON.stringify(_prefsCache),
}).catch(() => {});
}
// async function _prefsLoad() {
// if (!isLoggedIn()) return;
// try {
// const data = await apiFetch('/api/preferences', { method: 'GET' });
// Object.assign(_prefsCache, data);
// } catch (e) {}
// }
//
// function _prefsFlush() {
// if (!_prefsDirty) return;
// _prefsDirty = false;
// if (!isLoggedIn()) return;
// apiFetch('/api/preferences', {
// method: 'PATCH',
// body: JSON.stringify(_prefsCache),
// }).catch(() => {});
// }
const lsPrefs = {
get(key, def) {