diff --git a/maubot/management/frontend/src/pages/dashboard/Instance.js b/maubot/management/frontend/src/pages/dashboard/Instance.js index d17bfb8..ac8674e 100644 --- a/maubot/management/frontend/src/pages/dashboard/Instance.js +++ b/maubot/management/frontend/src/pages/dashboard/Instance.js @@ -19,6 +19,7 @@ import AceEditor from "react-ace" import "brace/mode/yaml" import "brace/theme/github" import { ReactComponent as ChevronRight } from "../../res/chevron-right.svg" +import { ReactComponent as NoAvatarIcon } from "../../res/bot.svg" import PrefTable, { PrefInput, PrefSelect, PrefSwitch } from "../../components/PreferenceTable" import api from "../../api" import Spinner from "../../components/Spinner" @@ -73,13 +74,31 @@ class Instance extends BaseMainView { this.updateClientOptions() } + getAvatarMXC(client) { + return client.avatar_url === "disable" ? client.remote_avatar_url : client.avatar_url + } + + getAvatarURL(client) { + return api.getAvatarURL({ + id: client.id, + avatar_url: this.getAvatarMXC(client), + }) + } + clientSelectEntry = client => client && { id: client.id, value: client.id, label: (
- - {client.displayname || client.id} + {this.getAvatarMXC(client) + ? + : } + { + (client.displayname === "disable" + ? client.remote_displayname + : client.displayname + ) || client.id + }
), }