From 74d79ff205b2fa9430feaf2b612d13b45c24fa36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 20 Aug 2021 15:55:52 +0200 Subject: [PATCH] Watch RoomList.backgroundImage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/LoggedInView.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 44c65c73ff..1462cc646a 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -152,6 +152,7 @@ class LoggedInView extends React.Component { protected readonly _roomView: React.RefObject; protected readonly _resizeContainer: React.RefObject; protected compactLayoutWatcherRef: string; + protected backgroundImageWatcherRef: string; protected resizer: Resizer; constructor(props, context) { @@ -195,6 +196,9 @@ class LoggedInView extends React.Component { this.compactLayoutWatcherRef = SettingsStore.watchSetting( "useCompactLayout", null, this.onCompactLayoutChanged, ); + this.backgroundImageWatcherRef = SettingsStore.watchSetting( + "RoomList.backgroundImage", null, this.refreshBackgroundImage, + ); this.resizer = this.createResizer(); this.resizer.attach(); @@ -212,6 +216,7 @@ class LoggedInView extends React.Component { this._matrixClient.removeListener("RoomState.events", this.onRoomStateEvents); OwnProfileStore.instance.off(UPDATE_EVENT, this.refreshBackgroundImage); SettingsStore.unwatchSetting(this.compactLayoutWatcherRef); + SettingsStore.unwatchSetting(this.backgroundImageWatcherRef); this.resizer.detach(); }