mirror of https://github.com/vector-im/riot-web
Fix quoting messages from the search view (#7466)
parent
76839ec42e
commit
6f89267a31
|
@ -99,6 +99,7 @@ import { fetchInitialEvent } from "../../utils/EventUtils";
|
||||||
import { ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload";
|
import { ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload";
|
||||||
import AppsDrawer from '../views/rooms/AppsDrawer';
|
import AppsDrawer from '../views/rooms/AppsDrawer';
|
||||||
import { RightPanelPhases } from '../../stores/right-panel/RightPanelStorePhases';
|
import { RightPanelPhases } from '../../stores/right-panel/RightPanelStorePhases';
|
||||||
|
import { ActionPayload } from "../../dispatcher/payloads";
|
||||||
|
|
||||||
const DEBUG = false;
|
const DEBUG = false;
|
||||||
let debuglog = function(msg: string) {};
|
let debuglog = function(msg: string) {};
|
||||||
|
@ -818,7 +819,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
this.setState({ callState: call ? call.state : null });
|
this.setState({ callState: call ? call.state : null });
|
||||||
};
|
};
|
||||||
|
|
||||||
private onAction = payload => {
|
private onAction = async (payload: ActionPayload): Promise<void> => {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'message_sent':
|
case 'message_sent':
|
||||||
this.checkDesktopNotifications();
|
this.checkDesktopNotifications();
|
||||||
|
@ -897,6 +898,12 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
|
|
||||||
case Action.ComposerInsert: {
|
case Action.ComposerInsert: {
|
||||||
if (payload.composerType) break;
|
if (payload.composerType) break;
|
||||||
|
|
||||||
|
if (this.state.searching && payload.timelineRenderingType === TimelineRenderingType.Room) {
|
||||||
|
// we don't have the composer rendered in this state, so bring it back first
|
||||||
|
await this.onCancelSearchClick();
|
||||||
|
}
|
||||||
|
|
||||||
// re-dispatch to the correct composer
|
// re-dispatch to the correct composer
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
...payload,
|
...payload,
|
||||||
|
@ -1612,10 +1619,12 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
private onCancelSearchClick = () => {
|
private onCancelSearchClick = (): Promise<void> => {
|
||||||
this.setState({
|
return new Promise<void>(resolve => {
|
||||||
searching: false,
|
this.setState({
|
||||||
searchResults: null,
|
searching: false,
|
||||||
|
searchResults: null,
|
||||||
|
}, resolve);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue