You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-03 00:33:22 +03:00 
			
		
		
		
	Watch RoomList.backgroundImage
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
		@@ -152,6 +152,7 @@ class LoggedInView extends React.Component<IProps, IState> {
 | 
				
			|||||||
    protected readonly _roomView: React.RefObject<any>;
 | 
					    protected readonly _roomView: React.RefObject<any>;
 | 
				
			||||||
    protected readonly _resizeContainer: React.RefObject<ResizeHandle>;
 | 
					    protected readonly _resizeContainer: React.RefObject<ResizeHandle>;
 | 
				
			||||||
    protected compactLayoutWatcherRef: string;
 | 
					    protected compactLayoutWatcherRef: string;
 | 
				
			||||||
 | 
					    protected backgroundImageWatcherRef: string;
 | 
				
			||||||
    protected resizer: Resizer;
 | 
					    protected resizer: Resizer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    constructor(props, context) {
 | 
					    constructor(props, context) {
 | 
				
			||||||
@@ -195,6 +196,9 @@ class LoggedInView extends React.Component<IProps, IState> {
 | 
				
			|||||||
        this.compactLayoutWatcherRef = SettingsStore.watchSetting(
 | 
					        this.compactLayoutWatcherRef = SettingsStore.watchSetting(
 | 
				
			||||||
            "useCompactLayout", null, this.onCompactLayoutChanged,
 | 
					            "useCompactLayout", null, this.onCompactLayoutChanged,
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					        this.backgroundImageWatcherRef = SettingsStore.watchSetting(
 | 
				
			||||||
 | 
					            "RoomList.backgroundImage", null, this.refreshBackgroundImage,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.resizer = this.createResizer();
 | 
					        this.resizer = this.createResizer();
 | 
				
			||||||
        this.resizer.attach();
 | 
					        this.resizer.attach();
 | 
				
			||||||
@@ -212,6 +216,7 @@ class LoggedInView extends React.Component<IProps, IState> {
 | 
				
			|||||||
        this._matrixClient.removeListener("RoomState.events", this.onRoomStateEvents);
 | 
					        this._matrixClient.removeListener("RoomState.events", this.onRoomStateEvents);
 | 
				
			||||||
        OwnProfileStore.instance.off(UPDATE_EVENT, this.refreshBackgroundImage);
 | 
					        OwnProfileStore.instance.off(UPDATE_EVENT, this.refreshBackgroundImage);
 | 
				
			||||||
        SettingsStore.unwatchSetting(this.compactLayoutWatcherRef);
 | 
					        SettingsStore.unwatchSetting(this.compactLayoutWatcherRef);
 | 
				
			||||||
 | 
					        SettingsStore.unwatchSetting(this.backgroundImageWatcherRef);
 | 
				
			||||||
        this.resizer.detach();
 | 
					        this.resizer.detach();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user