@@ -1296,11 +1296,9 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
12961296 const composerInsertPayload = payload as ComposerInsertPayload ;
12971297 if ( composerInsertPayload . composerType ) break ;
12981298
1299- // If the dispatchee didn't request a timeline rendering type, use the current one.
1300- let timelineRenderingType : TimelineRenderingType =
1301- composerInsertPayload . timelineRenderingType ?? this . state . timelineRenderingType ;
1299+ let timelineRenderingType : TimelineRenderingType | undefined ;
13021300 // ThreadView handles Action.ComposerInsert itself due to it having its own editState
1303- if ( timelineRenderingType === TimelineRenderingType . Thread ) break ;
1301+ if ( composerInsertPayload . timelineRenderingType === TimelineRenderingType . Thread ) break ;
13041302 if (
13051303 this . state . timelineRenderingType === TimelineRenderingType . Search &&
13061304 composerInsertPayload . timelineRenderingType === TimelineRenderingType . Search
@@ -1310,6 +1308,12 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
13101308 timelineRenderingType = TimelineRenderingType . Room ;
13111309 }
13121310
1311+ // If the dispatchee didn't request a timeline rendering type, use the current one.
1312+ timelineRenderingType =
1313+ timelineRenderingType ??
1314+ composerInsertPayload . timelineRenderingType ??
1315+ this . state . timelineRenderingType ;
1316+
13131317 // re-dispatch to the correct composer
13141318 defaultDispatcher . dispatch < ComposerInsertPayload > ( {
13151319 ...composerInsertPayload ,
0 commit comments