Remove more needless usages of makeMediaUrl

This is only really needed in specific cases, e.g. localUser which isn't
attached to a connection and thus needs a little help. Notes for when
this is needed is added for future readers.

(cherry picked from commit ef953b7574)
This commit is contained in:
Joshua Goins
2024-11-16 12:29:35 -05:00
parent ae12c838bd
commit d5c3054da4
9 changed files with 18 additions and 12 deletions

View File

@@ -34,7 +34,8 @@ FormCard.FormCardPage {
padding: 0
source: root.connection && root.connection.localUser.avatarMediaId ? root.connection.makeMediaUrl("mxc://" + root.connection.localUser.avatarMediaId) : ""
// Note: User::avatarUrl does not set user_id, and thus cannot be used directly here. Hence the makeMediaUrl.
source: root.connection && (root.connection.localUser.avatarUrl.toString().length > 0 ? root.connection.makeMediaUrl(root.connection.localUser.avatarUrl) : "")
name: root.connection.localUser.displayName
onClicked: {
@@ -122,7 +123,8 @@ FormCard.FormCardPage {
text: "https://matrix.to/#/" + root.connection.localUser.id,
title: root.connection.localUser.displayName,
subtitle: root.connection.localUser.id,
avatarSource: root.connection.makeMediaUrl(root.connection.localUser.avatarUrl)
// Note: User::avatarUrl does not set user_id, and thus cannot be used directly here. Hence the makeMediaUrl.
avatarSource: root.connection && (root.connection.localUser.avatarUrl.toString().length > 0 ? root.connection.makeMediaUrl(root.connection.localUser.avatarUrl) : "")
});
if (typeof root.closeDialog === "function") {
root.closeDialog();