Disabe search input in encrypted room
authorAjay Bura <ajbura@gmail.com>
Mon, 17 Jan 2022 06:49:35 +0000 (12:19 +0530)
committerAjay Bura <ajbura@gmail.com>
Mon, 17 Jan 2022 06:49:35 +0000 (12:19 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/app/molecules/room-search/RoomSearch.jsx

index 39b83b405338465044f561ec51816f579f588f47..3a86cbee2294a812f8117382aa197c8afd3f2efd 100644 (file)
@@ -109,8 +109,8 @@ function RoomSearch({ roomId }) {
   const searchTerm = searchData?._query.search_categories.room_events.search_term ?? '';
 
   const handleSearch = (e) => {
-    if (isRoomEncrypted) return;
     e.preventDefault();
+    if (isRoomEncrypted) return;
     const searchTermInput = e.target.elements['room-search-input'];
     const term = searchTermInput.value.trim();
 
@@ -144,6 +144,7 @@ function RoomSearch({ roomId }) {
           <Input
             placeholder="Search for keywords"
             name="room-search-input"
+            disabled={isRoomEncrypted}
           />
           <Button iconSrc={SearchIC} variant="primary" type="submit">Search</Button>
         </div>