Add error handling for setupElementsData
This commit is contained in:
parent
4b8e9d71b1
commit
18394c5358
1 changed files with 20 additions and 16 deletions
|
|
@ -39,10 +39,11 @@ async function askForNotificationPermission() {
|
|||
}
|
||||
|
||||
async function setupElementsData() {
|
||||
try {
|
||||
const usr = await getAppUser();
|
||||
const usrPic = (await getChatPicture(usr.id))?.url;
|
||||
const usrInfo = await getUser(usr.id);
|
||||
const usrAbout = (await getUserAbout(usr.id)).about;
|
||||
const usrAbout = (await getUserAbout(usr.id))?.about;
|
||||
elements.contentUserName.forEach(e => {
|
||||
e.innerHTML = usr.pushName;
|
||||
})
|
||||
|
|
@ -55,6 +56,9 @@ async function setupElementsData() {
|
|||
elements.valueUserStatus.forEach(async e => {
|
||||
e.value = usrAbout.trim();
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
function loadChats() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue