commit a55a19e6e643a0fe6c8ca162fad10c8a11ea4085 parent 742676ca75976dd6918d8e1620e39fd719054f88 Author: MTRNord <mtrnord1@gmail.com> Date: Tue, 16 May 2023 23:32:50 +0200 try to fix 5 Diffstat:
| A | changelog.d/5.bugfix | | | 2 | ++ |
| M | src/app/sdk/client.ts | | | 4 | +++- |
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/changelog.d/5.bugfix b/changelog.d/5.bugfix @@ -0,0 +1 @@ +Make sure that we always use the correct avatar url +\ No newline at end of file diff --git a/src/app/sdk/client.ts b/src/app/sdk/client.ts @@ -408,7 +408,9 @@ export class MatrixClient extends EventEmitter { throw Error("Error fetching profile info. See console for error."); } const json = await resp.json() as IProfileInfo; - json.avatar_url = json.avatar_url?.replace("mxc://", `${this.user.hostname}/_matrix/media/v3/download/`); + if (json.avatar_url) { + json.avatar_url = this.convertMXC(json.avatar_url); + } this.profileInfo = json; const tx = this.database?.transaction('loginInfo', 'readwrite'); await tx?.store.put({