|
1 | 1 | /* |
2 | | -Copyright 2015, 2016 OpenMarket Ltd |
3 | | -Copyright 2017 Vector Creations Ltd |
4 | | -Copyright 2017, 2018, 2020 New Vector Ltd |
| 2 | +Copyright 2015 - 2021 The Matrix.org Foundation C.I.C. |
5 | 3 |
|
6 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 5 | you may not use this file except in compliance with the License. |
@@ -70,6 +68,7 @@ import SpaceStore from "../../stores/SpaceStore"; |
70 | 68 | import classNames from 'classnames'; |
71 | 69 | import GroupFilterPanel from './GroupFilterPanel'; |
72 | 70 | import CustomRoomTagPanel from './CustomRoomTagPanel'; |
| 71 | +import { mediaFromMxc } from "../../customisations/Media"; |
73 | 72 |
|
74 | 73 | // We need to fetch each pinned message individually (if we don't already have it) |
75 | 74 | // so each pinned message may trigger a request. Limit the number per room for sanity. |
@@ -223,9 +222,14 @@ class LoggedInView extends React.Component<IProps, IState> { |
223 | 222 | } |
224 | 223 |
|
225 | 224 | private refreshBackgroundImage = async (): Promise<void> => { |
226 | | - this.setState({ |
227 | | - backgroundImage: OwnProfileStore.instance.getHttpAvatarUrl(), |
228 | | - }); |
| 225 | + let backgroundImage = SettingsStore.getValue("RoomList.backgroundImage"); |
| 226 | + if (backgroundImage) { |
| 227 | + // convert to http before going much further |
| 228 | + backgroundImage = mediaFromMxc(backgroundImage).srcHttp; |
| 229 | + } else { |
| 230 | + backgroundImage = OwnProfileStore.instance.getHttpAvatarUrl(); |
| 231 | + } |
| 232 | + this.setState({ backgroundImage }); |
229 | 233 | }; |
230 | 234 |
|
231 | 235 | private onAction = (payload): void => { |
|
0 commit comments