Добавить отключаемое предупреждение о звонках в настройках

This commit is contained in:
AidarKC
2026-12-03 15:03:32 +03:00
parent d420ae5400
commit 30a58299a6
8 changed files with 50 additions and 8 deletions
@@ -0,0 +1,19 @@
import { state } from '../state.js';
import { getDevicePref, setDevicePref } from './device-prefs.js';
const PREFIX = 'showCallWarning:';
function key() {
const login = String(state.session?.login || '').trim().toLowerCase();
return login ? `${PREFIX}${login}` : null;
}
export function getShowCallWarning() {
const preference = key();
return preference ? getDevicePref(preference, true) !== false : true;
}
export function setShowCallWarning(show) {
const preference = key();
if (preference) setDevicePref(preference, Boolean(show));
}