Honour user-selected background image from settings

Fixes https://github.com/vector-im/element-web/issues/18705

This is provided as an easter egg, but more importantly as an a11y workaround.
pull/21833/head
Travis Ralston 2021-08-23 20:39:46 -06:00
parent 32343f3382
commit a0dc5d2987
1 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,5 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015 - 2021 The Matrix.org Foundation C.I.C.
Copyright 2017 Vector Creations Ltd
Copyright 2017, 2018, 2020 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -70,6 +68,7 @@ import SpaceStore from "../../stores/SpaceStore";
import classNames from 'classnames'; import classNames from 'classnames';
import GroupFilterPanel from './GroupFilterPanel'; import GroupFilterPanel from './GroupFilterPanel';
import CustomRoomTagPanel from './CustomRoomTagPanel'; import CustomRoomTagPanel from './CustomRoomTagPanel';
import { mediaFromMxc } from "../../customisations/Media";
// We need to fetch each pinned message individually (if we don't already have it) // We need to fetch each pinned message individually (if we don't already have it)
// so each pinned message may trigger a request. Limit the number per room for sanity. // 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> {
} }
private refreshBackgroundImage = async (): Promise<void> => { private refreshBackgroundImage = async (): Promise<void> => {
this.setState({ let backgroundImage = SettingsStore.getValue("RoomList.backgroundImage");
backgroundImage: OwnProfileStore.instance.getHttpAvatarUrl(), if (backgroundImage) {
}); // convert to http before going much further
backgroundImage = mediaFromMxc(backgroundImage).srcHttp;
} else {
backgroundImage = OwnProfileStore.instance.getHttpAvatarUrl();
}
this.setState({ backgroundImage });
}; };
private onAction = (payload): void => { private onAction = (payload): void => {