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,44 @@
import { t } from '../i18n/index.js';
import { openChannelAttachmentManager } from './channel-attachment-manager.js';
import { saveProfileAvatar } from '../services/user-profile-params.js';
export async function openAvatarWizard({
login,
storagePwd,
gateway,
navigate,
onAvatarSaved,
onStatus,
} = {}) {
const cleanLogin = String(login || '').trim();
const cleanStoragePwd = String(storagePwd || '').trim();
const cleanGateway = String(gateway || '').trim();
if (!cleanLogin || !cleanStoragePwd) {
throw new Error(t('screens.avatar_wizard.text_001'));
}
const item = await openChannelAttachmentManager({
login: cleanLogin,
storagePwd: cleanStoragePwd,
gateway: cleanGateway,
mode: 'avatar',
});
if (!item?.pr || !item?.size) return false;
if (typeof onStatus === 'function') {
onStatus(t('screens.avatar_wizard.text_002'));
}
await saveProfileAvatar(cleanLogin, item);
if (typeof onAvatarSaved === 'function') {
await onAvatarSaved(item);
}
if (typeof onStatus === 'function') {
onStatus('');
}
return true;
}