CORE/CONTENT test5593 и адаптация UI

This commit is contained in:
AidarKC
2026-11-27 00:47:13 +03:00
parent 205b7ad971
commit 873535654e
1271 changed files with 219621 additions and 1900 deletions
@@ -0,0 +1,39 @@
// Локальный выбор пользователя: каждый аккаунт подтверждает публичную историю отдельно
// на каждом устройстве. Сервер и блокчейн не хранят этот переключатель.
import { t } from '../i18n/index.js';
import { state } from '../state.js';
import { getDevicePref, setDevicePref } from './device-prefs.js';
import { confirmDialog } from '../components/confirm-dialog.js';
const PREFIX = 'showPublicHistoryWarning:';
export function getPublicHistoryRememberLabel() {
return t('dialogs.final.consent.remember_public_history');
}
function preferenceKey() {
const login = String(state.session?.login || '').trim().toLowerCase();
return login ? `${PREFIX}${login}` : null;
}
export function getShowPublicHistoryWarning() {
const key = preferenceKey();
return key ? getDevicePref(key, true) !== false : true;
}
export function setShowPublicHistoryWarning(show) {
const key = preferenceKey();
if (key) setDevicePref(key, Boolean(show));
}
export function confirmPublicHistoryAction(options = {}) {
if (!preferenceKey() || getShowPublicHistoryWarning()) {
return confirmDialog({
...options,
rememberChoice: {
label: getPublicHistoryRememberLabel(),
onConfirm: () => setShowPublicHistoryWarning(false),
},
});
}
return Promise.resolve(true);
}