Fix file list regression

This commit is contained in:
Jorik Schellekens 2020-05-26 15:56:16 +01:00
parent 29347d0c6a
commit fcbd197e7d
4 changed files with 32 additions and 19 deletions

View file

@ -63,6 +63,10 @@ limitations under the License.
padding-left: 32px; padding-left: 32px;
padding-top: 8px; padding-top: 8px;
position: relative; position: relative;
a {
display: flex;
}
} }
.mx_NotificationPanel .mx_EventTile_roomName a, .mx_NotificationPanel .mx_EventTile_roomName a,

View file

@ -108,6 +108,9 @@ export default class MessagePanel extends React.Component {
// whether to show reactions for an event // whether to show reactions for an event
showReactions: PropTypes.bool, showReactions: PropTypes.bool,
// whether to use the irc layout
useIRCLayout: PropTypes.bool,
}; };
// Force props to be loaded for useIRCLayout // Force props to be loaded for useIRCLayout
@ -119,7 +122,6 @@ export default class MessagePanel extends React.Component {
// display 'ghost' read markers that are animating away // display 'ghost' read markers that are animating away
ghostReadMarkers: [], ghostReadMarkers: [],
showTypingNotifications: SettingsStore.getValue("showTypingNotifications"), showTypingNotifications: SettingsStore.getValue("showTypingNotifications"),
useIRCLayout: this.useIRCLayout(SettingsStore.getValue("feature_irc_ui")),
}; };
// opaque readreceipt info for each userId; used by ReadReceiptMarker // opaque readreceipt info for each userId; used by ReadReceiptMarker
@ -172,8 +174,6 @@ export default class MessagePanel extends React.Component {
this._showTypingNotificationsWatcherRef = this._showTypingNotificationsWatcherRef =
SettingsStore.watchSetting("showTypingNotifications", null, this.onShowTypingNotificationsChange); SettingsStore.watchSetting("showTypingNotifications", null, this.onShowTypingNotificationsChange);
this._layoutWatcherRef = SettingsStore.watchSetting("feature_irc_ui", null, this.onLayoutChange);
} }
componentDidMount() { componentDidMount() {
@ -183,7 +183,6 @@ export default class MessagePanel extends React.Component {
componentWillUnmount() { componentWillUnmount() {
this._isMounted = false; this._isMounted = false;
SettingsStore.unwatchSetting(this._showTypingNotificationsWatcherRef); SettingsStore.unwatchSetting(this._showTypingNotificationsWatcherRef);
SettingsStore.unwatchSetting(this._layoutWatcherRef);
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
@ -202,17 +201,6 @@ export default class MessagePanel extends React.Component {
}); });
}; };
onLayoutChange = () => {
this.setState({
useIRCLayout: this.useIRCLayout(SettingsStore.getValue("feature_irc_ui")),
});
}
useIRCLayout(ircLayoutSelected) {
// if room is null we are not in a normal room list
return ircLayoutSelected && this.props.room;
}
/* get the DOM node representing the given event */ /* get the DOM node representing the given event */
getNodeForEventId(eventId) { getNodeForEventId(eventId) {
if (!this.eventNodes) { if (!this.eventNodes) {
@ -614,7 +602,7 @@ export default class MessagePanel extends React.Component {
isSelectedEvent={highlight} isSelectedEvent={highlight}
getRelationsForEvent={this.props.getRelationsForEvent} getRelationsForEvent={this.props.getRelationsForEvent}
showReactions={this.props.showReactions} showReactions={this.props.showReactions}
useIRCLayout={this.state.useIRCLayout} useIRCLayout={this.props.useIRCLayout}
/> />
</TileErrorBoundary> </TileErrorBoundary>
</li>, </li>,
@ -797,8 +785,6 @@ export default class MessagePanel extends React.Component {
this.props.className, this.props.className,
{ {
"mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps, "mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps,
"mx_IRCLayout": this.state.useIRCLayout,
"mx_GroupLayout": !this.state.useIRCLayout,
}, },
); );

View file

@ -164,6 +164,7 @@ export default createReactClass({
canReact: false, canReact: false,
canReply: false, canReply: false,
useIRCLayout: SettingsStore.getValue("feature_irc_ui"),
}; };
}, },
@ -193,6 +194,8 @@ export default createReactClass({
this._roomView = createRef(); this._roomView = createRef();
this._searchResultsPanel = createRef(); this._searchResultsPanel = createRef();
this._layoutWatcherRef = SettingsStore.watchSetting("feature_irc_ui", null, this.onLayoutChange);
}, },
_onReadReceiptsChange: function() { _onReadReceiptsChange: function() {
@ -532,6 +535,14 @@ export default createReactClass({
// no need to do this as Dir & Settings are now overlays. It just burnt CPU. // no need to do this as Dir & Settings are now overlays. It just burnt CPU.
// console.log("Tinter.tint from RoomView.unmount"); // console.log("Tinter.tint from RoomView.unmount");
// Tinter.tint(); // reset colourscheme // Tinter.tint(); // reset colourscheme
SettingsStore.unwatchSetting(this._layoutWatcherRef);
},
onLayoutChange: function() {
this.setState({
useIRCLayout: SettingsStore.getValue("feature_irc_ui"),
});
}, },
_onRightPanelStoreUpdate: function() { _onRightPanelStoreUpdate: function() {
@ -1980,6 +1991,13 @@ export default createReactClass({
highlightedEventId = this.state.initialEventId; highlightedEventId = this.state.initialEventId;
} }
const messagePanelClassNames = classNames(
"mx_RoomView_messagePanel",
{
"mx_IRCLayout": this.state.useIRCLayout,
"mx_GroupLayout": !this.state.useIRCLayout,
});
// console.info("ShowUrlPreview for %s is %s", this.state.room.roomId, this.state.showUrlPreview); // console.info("ShowUrlPreview for %s is %s", this.state.room.roomId, this.state.showUrlPreview);
const messagePanel = ( const messagePanel = (
<TimelinePanel <TimelinePanel
@ -1995,11 +2013,12 @@ export default createReactClass({
onScroll={this.onMessageListScroll} onScroll={this.onMessageListScroll}
onReadMarkerUpdated={this._updateTopUnreadMessagesBar} onReadMarkerUpdated={this._updateTopUnreadMessagesBar}
showUrlPreview = {this.state.showUrlPreview} showUrlPreview = {this.state.showUrlPreview}
className="mx_RoomView_messagePanel" className={messagePanelClassNames}
membersLoaded={this.state.membersLoaded} membersLoaded={this.state.membersLoaded}
permalinkCreator={this._getPermalinkCreatorForRoom(this.state.room)} permalinkCreator={this._getPermalinkCreatorForRoom(this.state.room)}
resizeNotifier={this.props.resizeNotifier} resizeNotifier={this.props.resizeNotifier}
showReactions={true} showReactions={true}
useIRCLayout={this.state.useIRCLayout}
/>); />);
let topUnreadMessagesBar = null; let topUnreadMessagesBar = null;

View file

@ -112,6 +112,9 @@ const TimelinePanel = createReactClass({
// whether to show reactions for an event // whether to show reactions for an event
showReactions: PropTypes.bool, showReactions: PropTypes.bool,
// whether to use the irc layout
useIRCLayout: PropTypes.bool,
}, },
statics: { statics: {
@ -1447,6 +1450,7 @@ const TimelinePanel = createReactClass({
getRelationsForEvent={this.getRelationsForEvent} getRelationsForEvent={this.getRelationsForEvent}
editState={this.state.editState} editState={this.state.editState}
showReactions={this.props.showReactions} showReactions={this.props.showReactions}
useIRCLayout={this.props.useIRCLayout}
/> />
); );
}, },