fix: avatar_url -> avatar: adrien me tue pas stp
This commit is contained in:
parent
d70b882930
commit
981b66f221
@ -26,7 +26,7 @@ class MyProfile extends Profile
|
|||||||
const responseData = await response.json();
|
const responseData = await response.json();
|
||||||
|
|
||||||
if (response.ok) {
|
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 null;
|
||||||
}
|
}
|
||||||
return responseData;
|
return responseData;
|
||||||
@ -37,7 +37,7 @@ class MyProfile extends Profile
|
|||||||
const responseData = await response.json();
|
const responseData = await response.json();
|
||||||
|
|
||||||
if (response.ok) {
|
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 null;
|
||||||
}
|
}
|
||||||
return responseData;
|
return responseData;
|
||||||
|
@ -123,8 +123,8 @@ export default class extends AbstractView {
|
|||||||
return `
|
return `
|
||||||
<div class='mb-3' id='profileInfo'>
|
<div class='mb-3' id='profileInfo'>
|
||||||
<h1>${this.username}</h1>
|
<h1>${this.username}</h1>
|
||||||
<a href=${this.profile.avatar_url} target='_blank'>
|
<a href=${this.profile.avatar} target='_blank'>
|
||||||
<img class='img-thumbnail' src=${this.profile.avatar_url} style='width:auto; max-height:20vh; min-height:10vh'>
|
<img class='img-thumbnail' src=${this.profile.avatar} style='width:auto; max-height:20vh; min-height:10vh'>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -86,7 +86,7 @@ export default class extends AbstractAuthenticatedView
|
|||||||
|
|
||||||
async displayAvatar() {
|
async displayAvatar() {
|
||||||
let avatar = document.getElementById('avatar');
|
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() {
|
async savePassword() {
|
||||||
@ -254,13 +254,13 @@ export default class extends AbstractAuthenticatedView
|
|||||||
|
|
||||||
async getHtml()
|
async getHtml()
|
||||||
{
|
{
|
||||||
const avatarUnchanged = client.me.avatar_url === '/static/avatars/default.avif';
|
const avatarUnchanged = client.me.avatar === '/static/avatars/default.avif';
|
||||||
|
|
||||||
return /* HTML */ `
|
return /* HTML */ `
|
||||||
<div class='container-fluid col-lg-8 d-flex rounded border border-2 bg-light-subtle py-3'>
|
<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'>
|
<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>
|
<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/*'>
|
<input id='avatarInput' class='d-none' type='file' accept='image/*'>
|
||||||
<div class='d-flex gap-2 mt-1 px-0'>
|
<div class='d-flex gap-2 mt-1 px-0'>
|
||||||
<span class='my-auto ms-1 me-auto' id='avatarDetail'></span>
|
<span class='my-auto ms-1 me-auto' id='avatarDetail'></span>
|
||||||
|
Loading…
Reference in New Issue
Block a user