mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
fix: message preview toggle is inverted in room list header (#31865)
This commit is contained in:
parent
c135c16824
commit
26779b10bd
@ -189,8 +189,8 @@ export class RoomListHeaderViewModel
|
||||
public toggleMessagePreview = (): void => {
|
||||
PosthogTrackers.trackInteraction("WebRoomListMessagePreviewToggle");
|
||||
|
||||
const isMessagePreviewEnabled = SettingsStore.getValue("RoomList.showMessagePreview");
|
||||
SettingsStore.setValue("RoomList.showMessagePreview", null, SettingLevel.DEVICE, !isMessagePreviewEnabled);
|
||||
const isMessagePreviewEnabled = !SettingsStore.getValue("RoomList.showMessagePreview");
|
||||
SettingsStore.setValue("RoomList.showMessagePreview", null, SettingLevel.DEVICE, isMessagePreviewEnabled);
|
||||
this.snapshot.merge({ isMessagePreviewEnabled });
|
||||
};
|
||||
}
|
||||
|
||||
@ -293,6 +293,7 @@ describe("RoomListHeaderViewModel", () => {
|
||||
vm.toggleMessagePreview();
|
||||
|
||||
expect(setValueSpy).toHaveBeenCalledWith("RoomList.showMessagePreview", null, expect.anything(), false);
|
||||
expect(vm.getSnapshot().isMessagePreviewEnabled).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user