When showing thread, always auto-focus its composer (#8115)

This commit is contained in:
Michael Telatynski 2022-03-23 10:54:40 +00:00 committed by GitHub
parent a8d65ab5c5
commit d9276426fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 34 deletions

View file

@ -13,10 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import RightPanelStore from "../../stores/right-panel/RightPanelStore";
import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases";
import dis from "../dispatcher";
import { Action } from "../actions";
import { TimelineRenderingType } from "../../contexts/RoomContext";
export const showThread = (props: {
rootEvent: MatrixEvent;
@ -41,6 +45,12 @@ export const showThread = (props: {
threadViewCard,
]);
}
// Focus the composer
dis.dispatch({
action: Action.FocusSendMessageComposer,
context: TimelineRenderingType.Thread,
});
};
export const showThreadPanel = () => {