Show signed in user's avatar

This commit is contained in:
2026-10-25 22:51:52 -05:00
parent 57287de742
commit 073f5bebf9
2 changed files with 11 additions and 10 deletions

View File

@@ -336,10 +336,11 @@ module W3DHubLauncher
def populate_account_information
account = MemCache[:settings].account
avatar_path = account ? "#{CACHE_PATH}/avatar_#{account&.user_id}#{File.extname(account&.avatar_uri)}" : nil
@account_container.clear do
# self avatar container
stack(width: 80, height: 1.0, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png")), tag: :account_avatar) do
stack(width: 80, height: 1.0, background_image: rounded_avatar(safe_get_image(avatar_path || "#{ROOT_PATH}/media/default.png")), tag: :account_avatar) do
# self online state container
stack(
width: 20,
@@ -378,6 +379,14 @@ module W3DHubLauncher
flow(fill: true)
end
end
if account && !account.avatar_uri.empty?
img = find_element_by_tag(@account_container, :account_avatar)
remote_image(avatar_path, url: account.avatar_uri, element: img) do |e, path|
e&.background_image = rounded_avatar(safe_get_image(path))
end
end
end
def button_up(id)