Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6663 from matrix-org/travis/fix-room-list
Browse files Browse the repository at this point in the history
Honour user-selected background image from settings
  • Loading branch information
turt2live authored Aug 24, 2021
2 parents 32343f3 + a0dc5d2 commit 924983d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2017, 2018, 2020 New Vector Ltd
Copyright 2015 - 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -70,6 +68,7 @@ import SpaceStore from "../../stores/SpaceStore";
import classNames from 'classnames';
import GroupFilterPanel from './GroupFilterPanel';
import CustomRoomTagPanel from './CustomRoomTagPanel';
import { mediaFromMxc } from "../../customisations/Media";

// 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.
Expand Down Expand Up @@ -223,9 +222,14 @@ class LoggedInView extends React.Component<IProps, IState> {
}

private refreshBackgroundImage = async (): Promise<void> => {
this.setState({
backgroundImage: OwnProfileStore.instance.getHttpAvatarUrl(),
});
let backgroundImage = SettingsStore.getValue("RoomList.backgroundImage");
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 => {
Expand Down

0 comments on commit 924983d

Please sign in to comment.