fix: avatar_url -> avatar: adrien me tue pas stp

This commit is contained in:
starnakin 2024-04-07 11:11:11 +02:00
parent d70b882930
commit 981b66f221
3 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@ class MyProfile extends Profile
const responseData = await response.json();
if (response.ok) {
this.avatar_url = responseData.avatar.substr(responseData.avatar.indexOf('static') - 1);
this.avatar = responseData.avatar.substr(responseData.avatar.indexOf('static') - 1);
return null;
}
return responseData;
@ -37,7 +37,7 @@ class MyProfile extends Profile
const responseData = await response.json();
if (response.ok) {
this.avatar_url = responseData.avatar.substr(responseData.avatar.indexOf('static') - 1);
this.avatar = responseData.avatar.substr(responseData.avatar.indexOf('static') - 1);
return null;
}
return responseData;

View File

@ -123,8 +123,8 @@ export default class extends AbstractView {
return `
<div class='mb-3' id='profileInfo'>
<h1>${this.username}</h1>
<a href=${this.profile.avatar_url} target='_blank'>
<img class='img-thumbnail' src=${this.profile.avatar_url} style='width:auto; max-height:20vh; min-height:10vh'>
<a href=${this.profile.avatar} target='_blank'>
<img class='img-thumbnail' src=${this.profile.avatar} style='width:auto; max-height:20vh; min-height:10vh'>
</a>
</div>
<div>

View File

@ -86,7 +86,7 @@ export default class extends AbstractAuthenticatedView
async displayAvatar() {
let avatar = document.getElementById('avatar');
avatar.src = client.me.avatar_url + '?t=' + new Date().getTime();
avatar.src = client.me.avatar + '?t=' + new Date().getTime();
}
async savePassword() {
@ -254,13 +254,13 @@ export default class extends AbstractAuthenticatedView
async getHtml()
{
const avatarUnchanged = client.me.avatar_url === '/static/avatars/default.avif';
const avatarUnchanged = client.me.avatar === '/static/avatars/default.avif';
return /* HTML */ `
<div class='container-fluid col-lg-8 d-flex rounded border border-2 bg-light-subtle py-3'>
<div class='row col-4 bg-body-tertiary border rounded p-2 m-2 d-flex justify-content-center align-items-center'>
<h2 class='border-bottom'>${lang.get('settingsAvatarTitle')}</h2>
<img id='avatar' class='rounded p-0' src=${client.me.avatar_url} style='cursor: pointer;'>
<img id='avatar' class='rounded p-0' src=${client.me.avatar} style='cursor: pointer;'>
<input id='avatarInput' class='d-none' type='file' accept='image/*'>
<div class='d-flex gap-2 mt-1 px-0'>
<span class='my-auto ms-1 me-auto' id='avatarDetail'></span>