Update MessageDelete.tsx

This commit is contained in:
7w1 committed 2026-03-05 11:18:14 -06:00
1 parent 6032f14d37
commit e71ab94d15
1 file changed
+7 -1
@@ -1,4 +1,4 @@
import { FormEventHandler, MouseEvent, useCallback } from 'react';
import { FormEventHandler, MouseEvent, useCallback, useEffect } from 'react';
import { Room, MatrixEvent } from '$types/matrix-sdk';
import { useSetAtom } from 'jotai';
import {
@@ -65,6 +65,12 @@ export function MessageDeleteInternal({ room, mEvent, onClose }: MessageDeleteIn
)
);
useEffect(() => {
if (deleteState.status === AsyncStatus.Success) {
onClose();
}
}, [deleteState.status, onClose]);
const handleSubmit: FormEventHandler<HTMLFormElement> = (evt) => {
evt.preventDefault();
const eventId = mEvent.getId();